Class ZipFileStream
Represents read-only stream from the zip file.
public sealed class ZipFileStream : FileStream
- Inheritance
-
objectMarshalByRefObjectStreamZipFileStream
- Inherited Members
- Extension Methods
Constructors
ZipFileStream(ZipStorageProvider, string)
Initializes new instance and initializes new system file stream.
public ZipFileStream(ZipStorageProvider provider, string path)
Parameters
providerZipStorageProviderZip provider
pathstringPath to file.
Properties
CanRead
Gets a value indicating whether the current stream supports reading.
public override bool CanRead { get; }
Property Value
- bool
CanSeek
Gets a value indicating whether the current stream supports seeking.
public override bool CanSeek { get; }
Property Value
- bool
True if the stream supports seeking, false otherwise.
CanWrite
Gets a value indicating whether the current stream supports writing.
public override bool CanWrite { get; }
Property Value
- bool
Length
Gets the length in bytes of the stream.
public override long Length { get; }
Property Value
- long
Position
Gets or sets the position within the current stream.
public override long Position { get; set; }
Property Value
- long
Methods
Dispose(bool)
Releases all unmanaged and optionally managed resources.
protected override void Dispose(bool disposing)
Parameters
disposingboolWhen true, managed resources are released.
Flush()
Clears all buffers for this stream and causes any buffered data to be written to the underlying device.
public override void Flush()
Read(byte[], int, int)
Reads data from stream and stores them into array.
public override int Read(byte[] array, int offset, int count)
Parameters
arraybyte[]Array where result is stored
offsetintOffset from beginning of file
countintNumber of characters which are read
Returns
- int
Seek(long, SeekOrigin)
Sets cursor position at specified position.
public override long Seek(long offset, SeekOrigin loc)
Parameters
offsetlongOffset from beginning of file
locSeekOriginReference points for seeking in the stream
Returns
- long
SetLength(long)
Sets the length of the current stream.
public override void SetLength(long value)
Parameters
valuelongThe desired length of the current stream in bytes.
Write(byte[], int, int)
Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
public override void Write(byte[] buffer, int offset, int count)
Parameters
bufferbyte[]Buffer
offsetintOffset
countintNumber of chars
WriteByte(byte)
Writes byte to stream.
public override void WriteByte(byte value)
Parameters
valuebyteValue to write