DumpableStream

Ecng.IO

Represents a stream wrapper that records all data read from and written to the underlying stream.

Erbt von: Stream

Konstruktoren

DumpableStream
public DumpableStream(Stream underlying, bool leaveOpen)
dumpableStream = DumpableStream(underlying, leaveOpen)

Represents a stream wrapper that records all data read from and written to the underlying stream.

underlying
The underlying stream to wrap.
leaveOpen
true to leave the underlying stream open after disposing; otherwise, false.

Eigenschaften

CanRead
public override bool CanRead { get; }
value = dumpableStream.CanRead

Gets a value indicating whether the current stream supports reading.

CanSeek
public override bool CanSeek { get; }
value = dumpableStream.CanSeek

Gets a value indicating whether the current stream supports seeking.

CanWrite
public override bool CanWrite { get; }
value = dumpableStream.CanWrite

Gets a value indicating whether the current stream supports writing.

Length
public override long Length { get; }
value = dumpableStream.Length

Gets the length in bytes of the stream.

Position
public override long Position { get; set; }
value = dumpableStream.Position
dumpableStream.Position = value

Gets or sets the position within the current stream.

ReadDump
public AllocationArray<byte> ReadDump { get; }
value = dumpableStream.ReadDump

Gets the allocation array that collects data read from the underlying stream.

WriteDump
public AllocationArray<byte> WriteDump { get; }
value = dumpableStream.WriteDump

Gets the allocation array that collects data written to the underlying stream.

Methoden

Dispose
protected override void Dispose(bool disposing)
dumpableStream.Dispose(disposing)

Disposes the command resources.

disposing
True if disposing managed resources.
Flush
public override void Flush()
dumpableStream.Flush()

When overridden in a derived class, clears all buffers for this stream and causes any buffered data to be written to the underlying device.

GetReadDump
public byte[] GetReadDump()
result = dumpableStream.GetReadDump()

Retrieves and clears the dump of data read from the underlying stream.

Rückgabe: A byte array containing the dumped read data.

GetWriteDump
public byte[] GetWriteDump()
result = dumpableStream.GetWriteDump()

Retrieves and clears the dump of data written to the underlying stream.

Rückgabe: A byte array containing the dumped write data.

Read
public override int Read(byte[] buffer, int offset, int count)
result = dumpableStream.Read(buffer, offset, count)

Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.

buffer
An array of bytes. When this method returns, the buffer contains the specified byte array with the values between and ( + - 1) replaced by the bytes read from the current source.
offset
The zero-based byte offset in at which to begin storing the data read from the current stream.
count
The maximum number of bytes to be read from the current stream.

Rückgabe: The total number of bytes read into the buffer.

Seek
public override long Seek(long offset, SeekOrigin origin)
result = dumpableStream.Seek(offset, origin)

When overridden in a derived class, sets the position within the current stream.

offset
A byte offset relative to the parameter.
origin
A value of type SeekOrigin indicating the reference point used to obtain the new position.

Rückgabe: The new position within the current stream.

SetLength
public override void SetLength(long value)
dumpableStream.SetLength(value)

When overridden in a derived class, sets the length of the current stream.

value
The desired length of the current stream in bytes.
Write
public override void Write(byte[] buffer, int offset, int count)
dumpableStream.Write(buffer, offset, count)

Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.

buffer
An array of bytes. This method copies bytes from to the current stream.
offset
The zero-based byte offset in at which to begin copying bytes to the current stream.
count
The number of bytes to be written to the current stream.