C# Класс NGettext.Loaders.ReadOnlyStreamWrapper

Stream wrapper that prevents closing and writing to underlying stream.
Наследование: Stream
Показать файл Открыть проект

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

Метод Описание
BeginRead ( byte buffer, int offset, int count, AsyncCallback callback, object state ) : IAsyncResult

Begins an asynchronous read operation.

BeginWrite ( byte buffer, int offset, int count, AsyncCallback callback, object state ) : IAsyncResult

Begins an asynchronous write operation.

Close ( ) : void

Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream.

EndRead ( IAsyncResult asyncResult ) : int

Waits for the pending asynchronous read to complete.

EndWrite ( IAsyncResult asyncResult ) : void

Ends an asynchronous write operation.

Flush ( ) : void

When overridden in a derived class, 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

When overridden in a derived class, reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.

ReadByte ( ) : int

Reads a byte from the stream and advances the position within the stream by one byte, or returns -1 if at the end of the stream.

ReadOnlyStreamWrapper ( Stream baseStream ) : System

Initializes a new instance of the ReadOnlyStreamWrapper class that wraps specified underlying stream.

Seek ( long offset, SeekOrigin origin ) : long

When overridden in a derived class, sets the position within the current stream.

SetLength ( long value ) : void

When overridden in a derived class, sets the length of the current stream.

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

When overridden in a derived class, 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.

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Releases the unmanaged resources used by the System.IO.Stream and optionally releases the managed resources.

Приватные методы

Метод Описание
_CheckIsClosed ( ) : void

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

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

Begins an asynchronous read operation.
Attempted an asynchronous read past the end of the stream, or a disk error occurs. One or more of the arguments is invalid. Methods were called after the stream was closed. The current Stream implementation does not support the read operation.
public BeginRead ( byte buffer, int offset, int count, AsyncCallback callback, object state ) : IAsyncResult
buffer byte The buffer to read the data into.
offset int The byte offset in at which to begin writing data read from the stream.
count int The maximum number of bytes to read.
callback AsyncCallback An optional asynchronous callback, to be called when the read is complete.
state object A user-provided object that distinguishes this particular asynchronous read request from other requests.
Результат IAsyncResult

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

Begins an asynchronous write operation.
Attempted an asynchronous write past the end of the stream, or a disk error occurs. One or more of the arguments is invalid. Methods were called after the stream was closed. The current Stream implementation does not support the write operation.
public BeginWrite ( byte buffer, int offset, int count, AsyncCallback callback, object state ) : IAsyncResult
buffer byte The buffer to write data from.
offset int The byte offset in from which to begin writing.
count int The maximum number of bytes to write.
callback AsyncCallback An optional asynchronous callback, to be called when the write is complete.
state object A user-provided object that distinguishes this particular asynchronous write request from other requests.
Результат IAsyncResult

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

Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream.
public Close ( ) : void
Результат void

Dispose() защищенный Метод

Releases the unmanaged resources used by the System.IO.Stream and optionally releases the managed resources.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources
Результат void

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

Waits for the pending asynchronous read to complete.
is null. did not originate from a method on the current stream. The stream is closed or an internal error has occurred.
public EndRead ( IAsyncResult asyncResult ) : int
asyncResult IAsyncResult The reference to the pending asynchronous request to finish.
Результат int

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

Ends an asynchronous write operation.
is null. did not originate from a method on the current stream. The stream is closed or an internal error has occurred.
public EndWrite ( IAsyncResult asyncResult ) : void
asyncResult IAsyncResult A reference to the outstanding asynchronous I/O request.
Результат void

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

When overridden in a derived class, clears all buffers for this stream and causes any buffered data to be written to the underlying device.
An I/O error occurs.
public Flush ( ) : void
Результат void

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

When overridden in a derived class, reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
The sum of and is larger than the buffer length. is null. or is negative. An I/O error occurs. The stream does not support reading. Methods were called after the stream was closed.
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 and ( + - 1) replaced by the bytes read from the current source.
offset int The zero-based byte offset in 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

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

Reads a byte from the stream and advances the position within the stream by one byte, or returns -1 if at the end of the stream.
The stream does not support reading. Methods were called after the stream was closed.
public ReadByte ( ) : int
Результат int

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

Initializes a new instance of the ReadOnlyStreamWrapper class that wraps specified underlying stream.
public ReadOnlyStreamWrapper ( Stream baseStream ) : System
baseStream Stream
Результат System

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

When overridden in a derived class, sets the position within the current stream.
An I/O error occurs. The stream does not support seeking, such as if the stream is constructed from a pipe or console output. Methods were called after the stream was closed.
public Seek ( long offset, SeekOrigin origin ) : long
offset long A byte offset relative to the parameter.
origin SeekOrigin A value of type indicating the reference point used to obtain the new position.
Результат long

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

When overridden in a derived class, sets the length of the current stream.
An I/O error occurs. The stream does not support both writing and seeking, such as if the stream is constructed from a pipe or console output. Methods were called after the stream was closed.
public SetLength ( long value ) : void
value long The desired length of the current stream in bytes.
Результат void

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

When overridden in a derived class, 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 bytes from to the current stream.
offset int The zero-based byte offset in 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.
An I/O error occurs. The stream does not support writing, or the stream is already closed. Methods were called after the stream was closed.
public WriteByte ( byte value ) : void
value byte The byte to write to the stream.
Результат void