C# 클래스 LZ4.LZ4Stream

Block compression stream. Allows to use LZ4 for stream compression.
상속: Stream
파일 보기 프로젝트 열기: MiloszKrajewski/lz4net 1 사용 예제들

공개 메소드들

메소드 설명
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.

LZ4Stream ( Stream innerStream, CompressionMode compressionMode, LZ4StreamFlags compressionFlags = LZ4StreamFlags.Default, int blockSize = 1024*1024 ) : System

Initializes a new instance of the LZ4Stream class.

LZ4Stream ( Stream innerStream, LZ4StreamMode compressionMode, LZ4StreamFlags compressionFlags = LZ4StreamFlags.Default, int blockSize = 1024*1024 ) : System

Initializes a new instance of the LZ4Stream class.

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.

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 T:System.IO.Stream and optionally releases the managed resources.

비공개 메소드들

메소드 설명
AcquireNextChunk ( ) : bool

Reads the next chunk from stream.

CombineLZ4Flags ( bool highCompression, bool interactiveRead ) : LZ4StreamFlags

Combines the LZ4 flags.

EndOfStream ( ) : EndOfStreamException

Returns EndOfStreamException.

FlushCurrentChunk ( ) : void

Flushes current chunk.

LZ4Stream ( Stream innerStream, CompressionMode compressionMode, bool highCompression, int blockSize = 1024*1024, bool interactiveRead = false ) : System
LZ4Stream ( Stream innerStream, LZ4StreamMode compressionMode, bool highCompression, int blockSize = 1024*1024, bool interactiveRead = false ) : System
NotSupported ( string operationName ) : NotSupportedException

Returns NotSupportedException.

ReadBlock ( byte buffer, int offset, int length ) : int

Reads the block of bytes. Contrary to Stream.Read does not read partial data if possible. If there is no data (yet) it waits.

ReadVarInt ( ) : ulong

Reads the variable length int. Work with assumption that value is in the stream and throws exception if it isn't. If you want to check if value is in the stream use TryReadVarInt instead.

ToLZ4StreamMode ( CompressionMode compressionMode ) : LZ4StreamMode

Converts CompressionMode to LZ4StreamMode.

TryReadVarInt ( ulong &result ) : bool

Tries to read variable length int.

WriteVarInt ( ulong value ) : void

Writes the variable length integer.

메소드 상세

Dispose() 보호된 메소드

Releases the unmanaged resources used by the T: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

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.
public Flush ( ) : void
리턴 void

LZ4Stream() 공개 메소드

Initializes a new instance of the LZ4Stream class.
public LZ4Stream ( Stream innerStream, CompressionMode compressionMode, LZ4StreamFlags compressionFlags = LZ4StreamFlags.Default, int blockSize = 1024*1024 ) : System
innerStream Stream The inner stream.
compressionMode CompressionMode The compression mode.
compressionFlags LZ4StreamFlags The compression flags.
blockSize int Size of the block.
리턴 System

LZ4Stream() 공개 메소드

Initializes a new instance of the LZ4Stream class.
public LZ4Stream ( Stream innerStream, LZ4StreamMode compressionMode, LZ4StreamFlags compressionFlags = LZ4StreamFlags.Default, int blockSize = 1024*1024 ) : System
innerStream Stream The inner stream.
compressionMode LZ4StreamMode The compression mode.
compressionFlags LZ4StreamFlags The compression flags.
blockSize int Size of the block.
리턴 System

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.
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.
public ReadByte ( ) : int
리턴 int

Seek() 공개 메소드

When overridden in a derived class, sets the position within the current stream.
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.
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.
public WriteByte ( byte value ) : void
value byte The byte to write to the stream.
리턴 void