All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.util.CountOutputStream

java.lang.Object
   |
   +----java.io.OutputStream
           |
           +----w3c.util.CountOutputStream

public class CountOutputStream
extends OutputStream
This class can be used to count number of bytes emitted to a stream. The stream will actually throw the data away. It's main function is to count the number of bytes emitted to a stream before actually emitting the bytes (that's not really efficient, but works enough).


Variable Index

 o count

Constructor Index

 o CountOutputStream()
Create a new instance of that class.

Method Index

 o close()
Close that count stream.
 o flush()
Flush that count stream.
 o getCount()
Get the current number of bytes emitted to that stream.
 o write(byte[])
Write an array of bytes to that stream.
 o write(byte[], int, int)
Write part of an array of bytes to that stream.
 o write(int)
Write a single byte to that stream.

Variables

 o count
 protected int count

Constructors

 o CountOutputStream
 public CountOutputStream()
Create a new instance of that class.

Methods

 o getCount
 public int getCount()
Get the current number of bytes emitted to that stream.

Returns:
The current count value.
 o close
 public void close()
Close that count stream.

Overrides:
close in class OutputStream
 o flush
 public void flush()
Flush that count stream.

Overrides:
flush in class OutputStream
 o write
 public void write(byte b[])
Write an array of bytes to that stream.

Overrides:
write in class OutputStream
 o write
 public void write(byte b[],
                   int off,
                   int len)
Write part of an array of bytes to that stream.

Overrides:
write in class OutputStream
 o write
 public void write(int b)
Write a single byte to that stream.

Overrides:
write in class OutputStream

All Packages  Class Hierarchy  This Package  Previous  Next  Index