Class CountOutputStream
An OutputStream
that counts the written bytes.
public class CountOutputStream : Stream, IDisposable, IAsyncDisposable
- Inheritance
-
CountOutputStream
- Implements
- Inherited Members
Remarks
An OutputStream
that counts the written bytes.
You should not use same instance of this class in different threads as far as it's not thread safe.
Constructors
CountOutputStream(Stream)
Creates an instance of output stream which counts written bytes.
public CountOutputStream(Stream outputStream)
Parameters
Properties
CanRead
public override bool CanRead { get; }
Property Value
CanSeek
public override bool CanSeek { get; }
Property Value
CanWrite
public override bool CanWrite { get; }
Property Value
Length
public override long Length { get; }
Property Value
Position
public override long Position { get; set; }
Property Value
Methods
Close()
public override void Close()
Flush()
public override void Flush()
GetAmountOfWrittenBytes()
Gets amount of bytes written to the inner output stream.
public virtual long GetAmountOfWrittenBytes()
Returns
- long
amount of bytes
Read(byte[], int, int)
public override int Read(byte[] buffer, int offset, int count)
Parameters
Returns
Seek(long, SeekOrigin)
public override long Seek(long offset, SeekOrigin origin)
Parameters
offset
longorigin
SeekOrigin
Returns
SetLength(long)
public override void SetLength(long value)
Parameters
value
long
Write(byte[])
public void Write(byte[] b)
Parameters
b
byte[]
Write(byte[], int, int)
public override void Write(byte[] b, int off, int len)
Parameters
Write(int)
public void Write(int b)
Parameters
b
int