Class CompressedFileStream
Inherited Members
Namespace: Tenray.ZoneTree.WAL
Assembly: ZoneTree.dll
Syntax
public sealed class CompressedFileStream : Stream, IAsyncDisposable, IDisposable
Constructors
| Improve this Doc View SourceCompressedFileStream(ILogger, IFileStreamProvider, string, int, bool, int, CompressionMethod, int)
Declaration
public CompressedFileStream(ILogger logger, IFileStreamProvider fileStreamProvider, string filePath, int blockSize, bool enableTailWriterJob, int tailWriterJobInterval, CompressionMethod compressionMethod, int compressionLevel)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | |
IFileStreamProvider | fileStreamProvider | |
string | filePath | |
int | blockSize | |
bool | enableTailWriterJob | |
int | tailWriterJobInterval | |
CompressionMethod | compressionMethod | |
int | compressionLevel |
Properties
| Improve this Doc View SourceCanRead
When overridden in a derived class, gets a value indicating whether the current stream supports reading.
Declaration
public override bool CanRead { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
| Improve this Doc View SourceCanSeek
When overridden in a derived class, gets a value indicating whether the current stream supports seeking.
Declaration
public override bool CanSeek { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
| Improve this Doc View SourceCanWrite
When overridden in a derived class, gets a value indicating whether the current stream supports writing.
Declaration
public override bool CanWrite { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
| Improve this Doc View SourceFilePath
Declaration
public string FilePath { get; }
Property Value
Type | Description |
---|---|
string |
Length
When overridden in a derived class, gets the length in bytes of the stream.
Declaration
public override long Length { get; }
Property Value
Type | Description |
---|---|
long | A long value representing the length of the stream in bytes. |
Overrides
Exceptions
Type | Condition |
---|---|
NotSupportedException | A class derived from |
ObjectDisposedException | Methods were called after the stream was closed. |
Position
When overridden in a derived class, gets or sets the position within the current stream.
Declaration
public override long Position { get; set; }
Property Value
Type | Description |
---|---|
long | The current position within the stream. |
Overrides
Exceptions
Type | Condition |
---|---|
IOException | An I/O error occurs. |
NotSupportedException | The stream does not support seeking. |
ObjectDisposedException | Methods were called after the stream was closed. |
Methods
| Improve this Doc View SourceClose()
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.
Declaration
public override void Close()
Overrides
| Improve this Doc View SourceDispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Dispose(bool)
Releases the unmanaged resources used by the Stream and optionally releases the managed resources.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing | true to release both managed and unmanaged resources; false to release only unmanaged resources. |
Overrides
| Improve this Doc View SourceFlush()
When overridden in a derived class, clears all buffers for this stream and causes any buffered data to be written to the underlying device.
Declaration
public override void Flush()
Overrides
Exceptions
Type | Condition |
---|---|
IOException | An I/O error occurs. |
GetFileContent()
Declaration
public byte[] GetFileContent()
Returns
Type | Description |
---|---|
byte[] |
GetFileContentIncludingTail()
Declaration
public byte[] GetFileContentIncludingTail()
Returns
Type | Description |
---|---|
byte[] |
Read(byte[], int, 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.
Declaration
public override int Read(byte[] buffer, int offset, int count)
Parameters
Type | Name | Description |
---|---|---|
byte[] | buffer | An array of bytes. When this method returns, the buffer contains the specified byte array with the values between |
int | offset | The zero-based byte offset in |
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. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached. |
Overrides
Exceptions
Type | Condition |
---|---|
ArgumentException | The sum of |
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
IOException | An I/O error occurs. |
NotSupportedException | The stream does not support reading. |
ObjectDisposedException | Methods were called after the stream was closed. |
Seek(long, SeekOrigin)
When overridden in a derived class, 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 |
SeekOrigin | origin | A value of type SeekOrigin indicating the reference point used to obtain the new position. |
Returns
Type | Description |
---|---|
long | The new position within the current stream. |
Overrides
Exceptions
Type | Condition |
---|---|
IOException | An I/O error occurs. |
NotSupportedException | The stream does not support seeking, such as if the stream is constructed from a pipe or console output. |
ObjectDisposedException | Methods were called after the stream was closed. |
SetLength(long)
When overridden in a derived class, 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
Exceptions
Type | Condition |
---|---|
IOException | An I/O error occurs. |
NotSupportedException | The stream does not support both writing and seeking, such as if the stream is constructed from a pipe or console output. |
ObjectDisposedException | Methods were called after the stream was closed. |
Write(byte[], int, int)
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.
Declaration
public override void Write(byte[] buffer, int offset, int count)
Parameters
Type | Name | Description |
---|---|---|
byte[] | buffer | An array of bytes. This method copies |
int | offset | The zero-based byte offset in |
int | count | The number of bytes to be written to the current stream. |
Overrides
Exceptions
Type | Condition |
---|---|
ArgumentException | The sum of |
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
IOException | An I/O error occurred, such as the specified file cannot be found. |
NotSupportedException | The stream does not support writing. |
ObjectDisposedException | Write(byte[], int, int) was called after the stream was closed. |
WriteTail()
Declaration
public void WriteTail()