Class ReadAheadInputStream

java.lang.Object
java.io.InputStream
com.mysql.cj.protocol.ReadAheadInputStream
All Implemented Interfaces:
java.io.Closeable, java.lang.AutoCloseable

public class ReadAheadInputStream
extends java.io.InputStream
A non-blocking buffered input stream. Reads more if it can, won't block to fill the buffer, only blocks to satisfy a request of read(byte[])
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected int currentPosition  
    protected boolean doDebug  
    protected int endOfCurrentData  
    protected Log log  
  • Constructor Summary

    Constructors 
    Constructor Description
    ReadAheadInputStream​(java.io.InputStream toBuffer, boolean debug, Log logTo)  
    ReadAheadInputStream​(java.io.InputStream toBuffer, int bufferSize, boolean debug, Log logTo)  
  • Method Summary

    Modifier and Type Method Description
    int available()  
    void close()  
    boolean markSupported()  
    int read()  
    int read​(byte[] b, int off, int len)  
    long skip​(long n)  

    Methods inherited from class java.io.InputStream

    mark, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skipNBytes, transferTo

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • ReadAheadInputStream

      public ReadAheadInputStream​(java.io.InputStream toBuffer, boolean debug, Log logTo)
    • ReadAheadInputStream

      public ReadAheadInputStream​(java.io.InputStream toBuffer, int bufferSize, boolean debug, Log logTo)
  • Method Details

    • 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
    • read

      public int read() throws java.io.IOException
      Specified by:
      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
    • 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
    • markSupported

      public boolean markSupported()
      Overrides:
      markSupported in class java.io.InputStream
    • skip

      public long skip​(long n) throws java.io.IOException
      Overrides:
      skip in class java.io.InputStream
      Throws:
      java.io.IOException