Class RewindableInputStream

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

    public class RewindableInputStream
    extends java.io.InputStream
    implements Rewindable
    • Field Detail

      • curBlockAvail

        private int curBlockAvail
        If curBlockAvail > 0, then there are curBlockAvail bytes available to be returned starting at curBlockPos in curBlock.buf.
      • curBlockPos

        private int curBlockPos
      • saving

        private boolean saving
        true unless willNotRewind has been called
      • in

        private final java.io.InputStream in
      • pretendClosed

        private boolean pretendClosed
      • eof

        private boolean eof
        true if we have got an EOF from the underlying InputStream
    • Constructor Detail

      • RewindableInputStream

        public RewindableInputStream​(java.io.InputStream in)
    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.InputStream
        Throws:
        java.io.IOException
      • read

        public int read()
                 throws java.io.IOException
        Specified by:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] b,
                        int off,
                        int len)
                 throws java.io.IOException
        Overrides:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • available

        public int available()
                      throws java.io.IOException
        Overrides:
        available in class java.io.InputStream
        Throws:
        java.io.IOException