C# Class GitSharp.Core.Util.IO

Input/Output utilities
Show file Open project: jagregory/GitSharp

Public Methods

Method Description
ReadFully ( FileInfo path ) : byte[]

Read an entire local file into memory as a byte array.

ReadFully ( FileInfo path, int max ) : byte[]

Read an entire local file into memory as a byte array.

ReadFully ( Stream fd, byte dst, int off, int len ) : void

Read the entire byte array into memory, or throw an exception.

ReadFully ( Stream fd, long pos, byte dst, int off, int len ) : void

Read the entire byte array into memory, or throw an exception.

skipFully ( Stream fd, long toSkip ) : void

Skip an entire region of an input stream. The input stream's position is moved forward by the number of requested bytes, discarding them from the input. This method does not return until the exact number of bytes requested has been skipped.

Method Details

ReadFully() public static method

Read an entire local file into memory as a byte array.
/// The file exists, but its contents cannot be read. ///
public static ReadFully ( FileInfo path ) : byte[]
path System.IO.FileInfo Location of the file to read.
return byte[]

ReadFully() public static method

Read an entire local file into memory as a byte array.
/// The file exists, but its contents cannot be Read. ///
public static ReadFully ( FileInfo path, int max ) : byte[]
path System.IO.FileInfo Location of the file to read.
max int /// Maximum number of bytes to Read, if the file is larger than /// this limit an IOException is thrown. ///
return byte[]

ReadFully() public static method

Read the entire byte array into memory, or throw an exception.
/// The stream ended before was fully populated. /// /// There was an error reading from the stream. ///
public static ReadFully ( Stream fd, byte dst, int off, int len ) : void
fd Stream Input stream to read the data from.
dst byte buffer that must be fully populated
off int position within the buffer to start writing to.
len int number of bytes that must be read.
return void

ReadFully() public static method

Read the entire byte array into memory, or throw an exception.
/// The ended before the requested number of /// bytes were read. /// /// The does not supports seeking. /// /// There was an error reading from the stream. ///
public static ReadFully ( Stream fd, long pos, byte dst, int off, int len ) : void
fd Stream Stream to read the data from.
pos long Position to read from the file at.
dst byte Buffer that must be fully populated, [off, off+len].
off int position within the buffer to start writing to.
len int number of bytes that must be read.
return void

skipFully() public static method

Skip an entire region of an input stream. The input stream's position is moved forward by the number of requested bytes, discarding them from the input. This method does not return until the exact number of bytes requested has been skipped.
/// The stream ended before the requested number of bytes were /// skipped. /// /// There was an error reading from the stream. ///
public static skipFully ( Stream fd, long toSkip ) : void
fd Stream The stream to skip bytes from.
toSkip long /// Total number of bytes to be discarded. Must be >= 0. ///
return void