C# Класс CSharpUtils.Streams.SliceStream

Class to create a SliceStream that will slice a base Stream with its own cursor.
Наследование: ProxyStream
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
ThisLength long
ThisPosition long
ThisStart long

Открытые методы

Метод Описание
CreateWithBounds ( Stream BaseStream, long LowerBound, long UpperBound, bool CanWrite = null ) : SliceStream

Creates a SliceStream specifying a start offset and a end offset.

CreateWithLength ( Stream BaseStream, long ThisStart, long ThisLength = -1, bool CanWrite = null ) : SliceStream

Creates a SliceStream specifying a start offset and a length.

Read ( byte buffer, int offset, int count ) : int

Read a chunk from this SliceStream and move its cursor after that chunk. Only will be able to read inside the bounds of this Slice. It won't change the ParentStream cursor.

Seek ( long offset, SeekOrigin origin ) : long

Seeks the SliceStream without altering the original Stream.

SetLength ( long value ) : void

Not implemented.

Write ( byte buffer, int offset, int count ) : void

Writes a chunk from this SliceStream and move its cursor after that chunk. Only will be able to write inside the bounds of this Slice. It won't change the ParentStream cursor.

Защищенные методы

Метод Описание
SliceStream ( Stream BaseStream, long ThisStart, long ThisLength = -1, bool CanWrite = null, bool AllowSliceOutsideHigh = true ) : System

Creates a SliceStream specifying a start offset and a length. Please use CreateWithLength or CreateWithBounds to initialite the object.

Описание методов

CreateWithBounds() статический публичный Метод

Creates a SliceStream specifying a start offset and a end offset.
static public CreateWithBounds ( Stream BaseStream, long LowerBound, long UpperBound, bool CanWrite = null ) : SliceStream
BaseStream Stream Parent Stream
LowerBound long
UpperBound long
CanWrite bool Determines if the Stream will be writtable.
Результат SliceStream

CreateWithLength() статический публичный Метод

Creates a SliceStream specifying a start offset and a length.
static public CreateWithLength ( Stream BaseStream, long ThisStart, long ThisLength = -1, bool CanWrite = null ) : SliceStream
BaseStream Stream Base Stream
ThisStart long Starting Offset
ThisLength long Length of the Slice
CanWrite bool Determines if the Stream will be writtable.
Результат SliceStream

Read() публичный Метод

Read a chunk from this SliceStream and move its cursor after that chunk. Only will be able to read inside the bounds of this Slice. It won't change the ParentStream cursor.
public Read ( byte buffer, int offset, int count ) : int
buffer byte ByteArray to write to
offset int Offset of the ByteArray to write to
count int Number of bytes to read
Результат int

Seek() публичный Метод

Seeks the SliceStream without altering the original Stream.
public Seek ( long offset, SeekOrigin origin ) : long
offset long Offset to seek
origin SeekOrigin Origin for the seeking
Результат long

SetLength() публичный Метод

Not implemented.
public SetLength ( long value ) : void
value long
Результат void

SliceStream() защищенный Метод

Creates a SliceStream specifying a start offset and a length. Please use CreateWithLength or CreateWithBounds to initialite the object.
protected SliceStream ( Stream BaseStream, long ThisStart, long ThisLength = -1, bool CanWrite = null, bool AllowSliceOutsideHigh = true ) : System
BaseStream Stream Base Stream
ThisStart long Starting Offset
ThisLength long Length of the Slice
CanWrite bool Determines if the Stream will be writtable.
AllowSliceOutsideHigh bool
Результат System

Write() публичный Метод

Writes a chunk from this SliceStream and move its cursor after that chunk. Only will be able to write inside the bounds of this Slice. It won't change the ParentStream cursor.
public Write ( byte buffer, int offset, int count ) : void
buffer byte ByteArray to read from
offset int Offset of the ByteArray to read from
count int Number of bytes to write
Результат void

Описание свойств

ThisLength защищенное свойство

Length of this SliceStream.
protected long ThisLength
Результат long

ThisPosition защищенное свойство

Cursor for this SliceStream.
protected long ThisPosition
Результат long

ThisStart защищенное свойство

Start offset of this SliceStream relative to ParentStream.
protected long ThisStart
Результат long