| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private int | |
| protected OutputStream |
| Access | Constructor and Description |
|---|---|
| public | CounterOutputStream()
Create a CounterOutputStream that will discard any bytes written but still coutn them and call its reset method so that the count is intially zero. |
| Modifier and Type | Method and Description |
|---|---|
| public int | clearLimit()
Implements org. Clear any limit set by setLimit. |
| public int | Returns: the number of bytes written since the last reset() callGet count of bytes written to the stream since the last reset() call. |
| public void | setLimit(int
The length to set limit)Implements org. Set a limit at which an exception will be thrown. |
| public void | |
| public void | |
| public void | write(byte[]
the data. b, int the start offset in the data. off, int the number of bytes to write. len)Overrides java. Add len to the count, discard the data. |
| count | back to summary |
|---|---|
| private int count | |
| limit | back to summary |
|---|---|
| private int limit | |
| out | back to summary |
|---|---|
| protected OutputStream out | |
| CounterOutputStream | back to summary |
|---|---|
| public CounterOutputStream() Create a CounterOutputStream that will discard any bytes written but still coutn them and call its reset method so that the count is intially zero. | |
| clearLimit | back to summary |
|---|---|
| public int clearLimit() Implements org. Doc from org. Clear any limit set by setLimit. After this call no limit checking will be made on any read until a setLimit()) call is made.
| |
| getCount | back to summary |
|---|---|
| public int getCount() Get count of bytes written to the stream since the last reset() call.
| |
| setLimit | back to summary |
|---|---|
| public void setLimit(int limit) Implements org. Set a limit at which an exception will be thrown. This allows callers
to count the number of bytes up to some point, without having to complete
the count. E.g. a caller may only want to see if some object will write out
over 4096 bytes, without waiting for all 200,000 bytes of the object to be written.
| |
| setOutputStream | back to summary |
|---|---|
| public void setOutputStream(OutputStream out) | |
| write | back to summary |
|---|---|
| public void write(int b) throws IOException Implements abstract java. Add 1 to the count.
| |
| write | back to summary |
|---|---|
| public void write(byte[] b, int off, int len) throws IOException Overrides java. Add len to the count, discard the data.
| |