Table of Contents

Class ZipFileStream

Namespace
CMS.IO.Zip
Assembly
CMS.IO.dll

Represents read-only stream from the zip file.

public sealed class ZipFileStream : FileStream
Inheritance
object
MarshalByRefObject
Stream
ZipFileStream
Inherited Members
Extension Methods

Constructors

ZipFileStream(ZipStorageProvider, string)

Initializes new instance and initializes new system file stream.

public ZipFileStream(ZipStorageProvider provider, string path)

Parameters

provider ZipStorageProvider

Zip provider

path string

Path 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

disposing bool

When 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

array byte[]

Array where result is stored

offset int

Offset from beginning of file

count int

Number 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

offset long

Offset from beginning of file

loc SeekOrigin

Reference points for seeking in the stream

Returns

long

SetLength(long)

Sets the length of the current stream.

public override void SetLength(long value)

Parameters

value long

The 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

buffer byte[]

Buffer

offset int

Offset

count int

Number of chars

WriteByte(byte)

Writes byte to stream.

public override void WriteByte(byte value)

Parameters

value byte

Value to write