C# Class NContrib.Extensions.StreamExtensions

显示文件 Open project: veracross/ncontrib

Public Methods

Method Description
GetMime ( this stream ) : string

Use MIME magic to find the MIME type for this stream.

256 bytes (or the total number of bytes in the stream if 256 are not available) are read from the current stream location to detect the MIME type. If the stream support seeking, the stream position will be moved back after the sample is taken.

ReadAllBytes ( this stream, int bufferSize = 32768 ) : byte[]

Reads the entire contents of a stream into a byte array

Method Details

GetMime() public static method

Use MIME magic to find the MIME type for this stream.
256 bytes (or the total number of bytes in the stream if 256 are not available) are read from the current stream location to detect the MIME type. If the stream support seeking, the stream position will be moved back after the sample is taken.
public static GetMime ( this stream ) : string
stream this
return string

ReadAllBytes() public static method

Reads the entire contents of a stream into a byte array
public static ReadAllBytes ( this stream, int bufferSize = 32768 ) : byte[]
stream this
bufferSize int
return byte[]