Table of Contents

Class CountOutputStream

Namespace
iText.Kernel.Pdf
Assembly
itext.kernel.dll

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

outputStream Stream

inner Stream

Properties

CanRead

public override bool CanRead { get; }

Property Value

bool

CanSeek

public override bool CanSeek { get; }

Property Value

bool

CanWrite

public override bool CanWrite { get; }

Property Value

bool

Length

public override long Length { get; }

Property Value

long

Position

public override long Position { get; set; }

Property Value

long

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

buffer byte[]
offset int
count int

Returns

int

Seek(long, SeekOrigin)

public override long Seek(long offset, SeekOrigin origin)

Parameters

offset long
origin SeekOrigin

Returns

long

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

b byte[]
off int
len int

Write(int)

public void Write(int b)

Parameters

b int