C# 클래스 Revenj.ChunkedMemoryStream

In memory stream with 8192 blocks to avoid LOH issues. Since .NET places objects larger that 85000 bytes into LOH, avoid it as much as possible by using list of smaller blocks.
상속: Stream
파일 보기 프로젝트 열기: ngs-doo/revenj 1 사용 예제들

공개 메소드들

메소드 설명
ChunkedMemoryStream ( ) : System

Create new empty stream

ChunkedMemoryStream ( Stream another ) : System

Create in memory stream based on another stream. Provided stream will not be disposed.

ChunkedMemoryStream ( Stream another, bool dispose, bool reset ) : System

Create in memory stream based on another stream. Specify whether should provided stream be disposed after copying.

CopyTo ( Stream stream ) : void

Optimized version of copy to stream

Equals ( Stream another ) : bool

Compare two streams. Length and content will be compared.

Flush ( ) : void

Flush stream. Does nothing.

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

Read buffer from the stream. Can return less then specified count if remaining block size is less than specified count

ReadByte ( ) : int

Read a single byte

Seek ( long offset, SeekOrigin origin ) : long

Seek to position in the stream.

SetLength ( long value ) : void

Set new length of the stream. Adjusts the current position if new length is larger then it.

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

Write buffer to stream. Advances current position by count. Increases length if necessary. New blocks will be added as required. It's best to use buffer of size 8192

WriteByte ( byte value ) : void

Write byte to stream. Advances current position by one. Adds a new block if necessary.

보호된 메소드들

메소드 설명
Dispose ( bool disposing ) : void

메소드 상세

ChunkedMemoryStream() 공개 메소드

Create new empty stream
public ChunkedMemoryStream ( ) : System
리턴 System

ChunkedMemoryStream() 공개 메소드

Create in memory stream based on another stream. Provided stream will not be disposed.
public ChunkedMemoryStream ( Stream another ) : System
another Stream stream to copy
리턴 System

ChunkedMemoryStream() 공개 메소드

Create in memory stream based on another stream. Specify whether should provided stream be disposed after copying.
public ChunkedMemoryStream ( Stream another, bool dispose, bool reset ) : System
another Stream stream to copy
dispose bool dispose provided stream
reset bool reset provided stream to original position
리턴 System

CopyTo() 공개 메소드

Optimized version of copy to stream
public CopyTo ( Stream stream ) : void
stream Stream destination stream
리턴 void

Dispose() 보호된 메소드

protected Dispose ( bool disposing ) : void
disposing bool
리턴 void

Equals() 공개 메소드

Compare two streams. Length and content will be compared.
public Equals ( Stream another ) : bool
another Stream stream to compare
리턴 bool

Flush() 공개 메소드

Flush stream. Does nothing.
public Flush ( ) : void
리턴 void

Read() 공개 메소드

Read buffer from the stream. Can return less then specified count if remaining block size is less than specified count
public Read ( byte buffer, int offset, int count ) : int
buffer byte copy to buffer
offset int offset in the buffer
count int maximum size to read
리턴 int

ReadByte() 공개 메소드

Read a single byte
public ReadByte ( ) : int
리턴 int

Seek() 공개 메소드

Seek to position in the stream.
public Seek ( long offset, SeekOrigin origin ) : long
offset long offset at stream
origin SeekOrigin position type
리턴 long

SetLength() 공개 메소드

Set new length of the stream. Adjusts the current position if new length is larger then it.
public SetLength ( long value ) : void
value long new length
리턴 void

Write() 공개 메소드

Write buffer to stream. Advances current position by count. Increases length if necessary. New blocks will be added as required. It's best to use buffer of size 8192
public Write ( byte buffer, int offset, int count ) : void
buffer byte provided bytes
offset int offset in bytes
count int total length
리턴 void

WriteByte() 공개 메소드

Write byte to stream. Advances current position by one. Adds a new block if necessary.
public WriteByte ( byte value ) : void
value byte byte to write
리턴 void