Package org.jcsp.net2
Class ResettableByteArrayInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.ByteArrayInputStream
-
- org.jcsp.net2.ResettableByteArrayInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
final class ResettableByteArrayInputStream extends java.io.ByteArrayInputStream
This class is used by the ObjectNetworkMessageFilter. It acts as a ByteArrayInputStream, but allows the internal byte array to be replaced by another. This stops unnecessary object creation
-
-
Constructor Summary
Constructors Constructor Description ResettableByteArrayInputStream(byte[] bytes)
Creates a new ResettableByteArrayInputStream
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
reset(byte[] bytes)
Replaces the internal byte array
-