C# Class Recognos.Core.FileUtilities

Utilities for handling files
Mostrar archivo Open project: Recognos/Recognos.Core

Public Methods

Method Description
ReadBinaryContent ( this stream ) : byte[]

Reads the content from the stream as binary.

ReadBinaryContentAsync ( this stream ) : Task

Reads the content from the stream as binary.

ReadContent ( this stream ) : string

Reads the content from the stream.

ReadContent ( this stream, Encoding encoding ) : string

Reads the content from the stream.

ReadContentAsync ( this stream ) : Task

Reads the content from the stream.

ReadContentAsync ( this stream, Encoding encoding ) : Task

Reads the content from the stream.

SaveToFile ( this stream, string pathToFile ) : void

Saves a stream to a file.

SaveToFileAsync ( this stream, string pathToFile ) : System.Threading.Tasks.Task

Saves a stream to a file.

SaveToStream ( this stream, Stream outputStream ) : void

Saves a stream to another stream.

SaveToStreamAsync ( this stream, Stream outputStream ) : System.Threading.Tasks.Task

Saves a stream to another stream.

Private Methods

Method Description
ComputeSHA1Hash ( string pathToFile ) : string
ComputeSHA1Hash ( this stream ) : string

Method Details

ReadBinaryContent() public static method

Reads the content from the stream as binary.
public static ReadBinaryContent ( this stream ) : byte[]
stream this The stream.
return byte[]

ReadBinaryContentAsync() public static method

Reads the content from the stream as binary.
public static ReadBinaryContentAsync ( this stream ) : Task
stream this The stream.
return Task

ReadContent() public static method

Reads the content from the stream.
public static ReadContent ( this stream ) : string
stream this The stream.
return string

ReadContent() public static method

Reads the content from the stream.
public static ReadContent ( this stream, Encoding encoding ) : string
stream this The stream.
encoding System.Text.Encoding The encoding.
return string

ReadContentAsync() public static method

Reads the content from the stream.
public static ReadContentAsync ( this stream ) : Task
stream this The stream.
return Task

ReadContentAsync() public static method

Reads the content from the stream.
public static ReadContentAsync ( this stream, Encoding encoding ) : Task
stream this The stream.
encoding System.Text.Encoding The encoding.
return Task

SaveToFile() public static method

Saves a stream to a file.
public static SaveToFile ( this stream, string pathToFile ) : void
stream this The stream.
pathToFile string The path to file.
return void

SaveToFileAsync() public static method

Saves a stream to a file.
public static SaveToFileAsync ( this stream, string pathToFile ) : System.Threading.Tasks.Task
stream this The stream.
pathToFile string The path to file.
return System.Threading.Tasks.Task

SaveToStream() public static method

Saves a stream to another stream.
public static SaveToStream ( this stream, Stream outputStream ) : void
stream this The input stream.
outputStream System.IO.Stream The output stream.
return void

SaveToStreamAsync() public static method

Saves a stream to another stream.
public static SaveToStreamAsync ( this stream, Stream outputStream ) : System.Threading.Tasks.Task
stream this The input stream.
outputStream System.IO.Stream The output stream.
return System.Threading.Tasks.Task