Package overit.geocall.util
Class OutputStreamCounter
java.lang.Object
java.io.OutputStream
overit.geocall.util.OutputStreamCounter
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
Class that extends
OutputStream that adds the ability to know the number
of bytes wrote.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of OutputStreamCounter -
Method Summary
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Field Details
-
_n
protected int _n -
_os
-
-
Constructor Details
-
OutputStreamCounter
Creates an instance of OutputStreamCounter- Parameters:
os- The OutputStream
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
getCount
public int getCount()Return the number of bytes write.- Returns:
- The number of bytes write.
-