C# Class Fody.PeImage.SubStream

Represents parts of a Stream, from a start byte offset for a given length.
Inheritance: Stream
显示文件 Open project: Fody/Stamp Class Usage Examples

Private Properties

Property Type Description

Public Methods

Method Description
Close ( ) : void

Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream. Instead of calling this method, ensure that the stream is properly disposed.

Flush ( ) : void

Clears all buffers for this stream and causes any buffered data to be written to the underlying device.

Read ( byte buffer, int offset, int count ) : int

Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.

Seek ( long offset, SeekOrigin origin ) : long

Sets the position within the current stream.

SetLength ( long value ) : void

Sets the length of the current stream.

SubStream ( Stream stream, long offset, long length, bool leaveParentOpen = false ) : System

Initializes a new instance of the SubStream class.

UpdateWindow ( long offset, long length ) : void

Updates the size of this SubStream relative to its parent stream.

Write ( byte buffer, int offset, int count ) : void

Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.

WriteByte ( byte value ) : void

Writes a byte to the current position in the stream and advances the position within the stream by one byte.

Method Details

Close() public method

Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream. Instead of calling this method, ensure that the stream is properly disposed.
public Close ( ) : void
return void

Flush() public method

Clears all buffers for this stream and causes any buffered data to be written to the underlying device.
public Flush ( ) : void
return void

Read() public method

Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
public Read ( byte buffer, int offset, int count ) : int
buffer byte /// An array of bytes. When this method returns, the buffer contains the specified byte array with the values between offset /// and (offset + count - 1) replaced by the bytes read from the current source. ///
offset int /// The zero-based byte offset in buffer at which to begin storing the data read from the current stream. ///
count int /// The maximum number of bytes to be read from the current stream. ///
return int

Seek() public method

Sets the position within the current stream.
public Seek ( long offset, SeekOrigin origin ) : long
offset long /// A byte offset relative to the origin parameter. ///
origin SeekOrigin /// A value of type SeekOrigin indicating the reference point used to obtain the new position. ///
return long

SetLength() public method

Sets the length of the current stream.
public SetLength ( long value ) : void
value long /// The desired length of the current stream in bytes. ///
return void

SubStream() public method

Initializes a new instance of the SubStream class.
public SubStream ( Stream stream, long offset, long length, bool leaveParentOpen = false ) : System
stream Stream /// The parent stream of this stream. ///
offset long /// The offset at which the stream starts. ///
length long /// The length of the . ///
leaveParentOpen bool /// A value indicating whether the parent stream should be closed when this /// is closed, or not. ///
return System

UpdateWindow() public method

Updates the size of this SubStream relative to its parent stream.
public UpdateWindow ( long offset, long length ) : void
offset long /// The new offset. ///
length long /// The new length. ///
return void

Write() public method

Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
public Write ( byte buffer, int offset, int count ) : void
buffer byte /// An array of bytes. This method copies count bytes from buffer to the current stream. ///
offset int /// The zero-based byte offset in buffer at which to begin copying bytes to the current stream. ///
count int /// The number of bytes to be written to the current stream. ///
return void

WriteByte() public method

Writes a byte to the current position in the stream and advances the position within the stream by one byte.
public WriteByte ( byte value ) : void
value byte /// The byte to write to the stream. ///
return void