Package org.jcsp.net2
Class ResettableByteArrayOutputStream
java.lang.Object
java.io.OutputStream
java.io.ByteArrayOutputStream
org.jcsp.net2.ResettableByteArrayOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
This class is used by the ObjectNetworkMessageFilter. It acts as a normal ByteArrayOutputStream, but allows the
internal buffer to be reset in size, thereby regaining some resources.
-
Field Summary
Fields inherited from class java.io.ByteArrayOutputStream
buf, count
-
Constructor Summary
ConstructorsConstructorDescriptionResettableByteArrayOutputStream
(int size) Creates a new ResettableByteArrayOutputStream -
Method Summary
Modifier and TypeMethodDescription(package private) void
reset
(int size) Resets the internal bufferMethods inherited from class java.io.ByteArrayOutputStream
close, reset, size, toByteArray, toString, toString, toString, write, write, writeTo
Methods inherited from class java.io.OutputStream
flush, write
-
Constructor Details
-
ResettableByteArrayOutputStream
ResettableByteArrayOutputStream(int size) Creates a new ResettableByteArrayOutputStream- Parameters:
size
- The size of the internal buffer
-
-
Method Details
-
reset
void reset(int size) Resets the internal buffer- Parameters:
size
- The size to reset the internal buffer to
-