C# Класс Fody.PeImage.SubStream

Represents parts of a Stream, from a start byte offset for a given length.
Наследование: Stream
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание

Открытые методы

Метод Описание
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.

Описание методов

Close() публичный Метод

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
Результат void

Flush() публичный Метод

Clears all buffers for this stream and causes any buffered data to be written to the underlying device.
public Flush ( ) : void
Результат void

Read() публичный Метод

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. ///
Результат int

Seek() публичный Метод

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. ///
Результат long

SetLength() публичный Метод

Sets the length of the current stream.
public SetLength ( long value ) : void
value long /// The desired length of the current stream in bytes. ///
Результат void

SubStream() публичный Метод

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. ///
Результат System

UpdateWindow() публичный Метод

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. ///
Результат void

Write() публичный Метод

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. ///
Результат void

WriteByte() публичный Метод

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. ///
Результат void