Class PushbackInputStream

java.lang.Object
java.io.InputStream
io.fusionauth.http.io.PushbackInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

public class PushbackInputStream extends InputStream
An input stream that allows a portion of bytes read into a buffer to be pushed back to be read again.
Author:
Daniel DeGroff
  • Constructor Details

  • Method Details

    • getAvailableBufferedBytesRemaining

      public int getAvailableBufferedBytesRemaining()
    • push

      public void push(byte[] buffer, int offset, int length)
      Push back the bytes found in the provided buffer.
      Parameters:
      buffer - the buffer that contains bytes that should be pushed back into the stream.
      offset - the offset into the buffer where a read should start
      length - the length of bytes starting from the offset that are available to be read
    • read

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

      public int read() throws IOException
      Specified by:
      read in class InputStream
      Throws:
      IOException