Class LzmaEncodeStream
The stream which compresses data with LZMA on the fly.
Inherited Members
Namespace: SharpSevenZip.Lzma
Assembly: SharpSevenZip.dll
Syntax
public class LzmaEncodeStream : Stream, IAsyncDisposable, IDisposable
Constructors
| Edit this page View SourceLzmaEncodeStream()
Initializes a new instance of the LzmaEncodeStream class.
Declaration
public LzmaEncodeStream()
LzmaEncodeStream(Stream)
Initializes a new instance of the LzmaEncodeStream class.
Declaration
public LzmaEncodeStream(Stream outputStream)
Parameters
Type | Name | Description |
---|---|---|
Stream | outputStream | An output stream which supports writing. |
LzmaEncodeStream(Stream, int)
Initializes a new instance of the LzmaEncodeStream class.
Declaration
public LzmaEncodeStream(Stream outputStream, int bufferCapacity)
Parameters
Type | Name | Description |
---|---|---|
Stream | outputStream | An output stream which supports writing. |
int | bufferCapacity | A buffer size. The bigger size, the better compression. |
LzmaEncodeStream(int)
Initializes a new instance of the LzmaEncodeStream class.
Declaration
public LzmaEncodeStream(int bufferCapacity)
Parameters
Type | Name | Description |
---|---|---|
int | bufferCapacity | The buffer size. The bigger size, the better compression. |
Properties
| Edit this page View SourceCanRead
Gets a value indicating whether the current stream supports reading.
Declaration
public override bool CanRead { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceCanSeek
Gets a value indicating whether the current stream supports seeking.
Declaration
public override bool CanSeek { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceCanWrite
Gets a value indicating whether the current stream supports writing.
Declaration
public override bool CanWrite { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceLength
Gets the length in bytes of the output stream.
Declaration
public override long Length { get; }
Property Value
Type | Description |
---|---|
long |
Overrides
| Edit this page View SourcePosition
Gets or sets the position within the output stream.
Declaration
public override long Position { get; set; }
Property Value
Type | Description |
---|---|
long |
Overrides
Methods
| Edit this page View SourceDispose(bool)
Releases all unmanaged resources used by LzmaEncodeStream.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing |
Overrides
| Edit this page View SourceFlush()
Clears all buffers for this stream and causes any buffered data to be compressed and written.
Declaration
public override void Flush()
Overrides
| Edit this page View SourceRead(byte[], int, int)
Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
Declaration
public override int Read(byte[] buffer, int offset, int count)
Parameters
Type | Name | Description |
---|---|---|
byte[] | buffer | An array of bytes. |
int | offset | The zero-based byte offset in buffer at which to begin storing the data read from the current stream. |
int | count | The maximum number of bytes to be read from the current stream. |
Returns
Type | Description |
---|---|
int | The total number of bytes read into the buffer. |
Overrides
| Edit this page View SourceSeek(long, SeekOrigin)
Sets the position within the current stream.
Declaration
public override long Seek(long offset, SeekOrigin origin)
Parameters
Type | Name | Description |
---|---|---|
long | offset | A byte offset relative to the origin parameter. |
SeekOrigin | origin | A value of type System.IO.SeekOrigin indicating the reference point used to obtain the new position. |
Returns
Type | Description |
---|---|
long | The new position within the current stream. |
Overrides
| Edit this page View SourceSetLength(long)
Sets the length of the current stream.
Declaration
public override void SetLength(long value)
Parameters
Type | Name | Description |
---|---|---|
long | value | The desired length of the current stream in bytes. |
Overrides
| Edit this page View SourceToDecodeStream()
Converts the LzmaEncodeStream to the LzmaDecodeStream to read data.
Declaration
public LzmaDecodeStream ToDecodeStream()
Returns
Type | Description |
---|---|
LzmaDecodeStream |
Write(byte[], int, int)
Writes a sequence of bytes to the current stream and compresses it if necessary.
Declaration
public override void Write(byte[] buffer, int offset, int count)
Parameters
Type | Name | Description |
---|---|---|
byte[] | buffer | An array of bytes. |
int | offset | The zero-based byte offset in buffer at which to begin storing the data read from the current stream. |
int | count | The maximum number of bytes to be read from the current stream. |