Click or drag to resize

StreamGetByte Method (StreamReader)

Gives byte array from stream

Namespace:  SIC.File
Assembly:  SIC (in SIC.dll) Version: 19.1.23.1 (19.1.23.622)
Syntax
public static byte[] GetByte(
	StreamReader pStreamReader
)

Parameters

pStreamReader
Type: System.IOStreamReader

[Missing <param name="pStreamReader"/> documentation for "M:SIC.File.Stream.GetByte(System.IO.StreamReader)"]

Return Value

Type: Byte

[Missing <returns> documentation for "M:SIC.File.Stream.GetByte(System.IO.StreamReader)"]

Examples

In web controller action Create.

Data item complement with file data (byte array)

protected override ActionResult CreateOnActionResultPostSave(ref TemplateFile pItem)
{
    System.Web.HttpPostedFileBase lFile;
    lFile = Request.Files[0];
    System.IO.StreamReader lStreamReader = new System.IO.StreamReader(lFile.InputStream);
    pItem.Content = SIC.File.Stream.GetByte(lStreamReader);
    return base.CreateOnActionResultPostSave(ref pItem);
}
See Also