Class WrappedInputStream

java.lang.Object
java.io.InputStream
java.io.FilterInputStream
cardmanager.impl.networking.WrappedInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

public class WrappedInputStream extends FilterInputStream
This input stream works in conjunction with the WrappedOutputStream to introduce a protocol for reading arbitrary length data in a uniform way.

Note: See the javadoc for WrappedOutputStream for more information.

See Also:
  • Field Details

    • fPacketCount

      protected int fPacketCount
      Bytes left on input stream for current packet.
    • fDataInputStream

      protected DataInputStream fDataInputStream
      Data input stream. This stream is used to input the block sizes from the data stream that are written by the WrappedOutputStream.

      Note: The data input stream is only used for reading the byte count for performance reasons. We avoid the method indirection for reading the byte data.

    • fClosed

      protected boolean fClosed
      To mark that the stream is "closed".
  • Constructor Details

    • WrappedInputStream

      public WrappedInputStream(InputStream stream)
      Constructs a wrapper for the given an input stream.
  • Method Details