Package org.jcsp.net2

Class ResettableByteArrayOutputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable

    final class ResettableByteArrayOutputStream
    extends java.io.ByteArrayOutputStream
    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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void reset​(int size)
      Resets the internal buffer
      • Methods 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ResettableByteArrayOutputStream

        ResettableByteArrayOutputStream​(int size)
        Creates a new ResettableByteArrayOutputStream
        Parameters:
        size - The size of the internal buffer
    • Method Detail

      • reset

        void reset​(int size)
        Resets the internal buffer
        Parameters:
        size - The size to reset the internal buffer to