Package com.mysql.cj.protocol
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 intcurrentPositionprotected booleandoDebugprotected intendOfCurrentDataprotected Loglog -
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
-
Field Details
-
endOfCurrentData
protected int endOfCurrentData -
currentPosition
protected int currentPosition -
doDebug
protected boolean doDebug -
log
-
-
Constructor Details
-
ReadAheadInputStream
-
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:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read() throws java.io.IOException- Specified by:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
available
public int available() throws java.io.IOException- Overrides:
availablein classjava.io.InputStream- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.InputStream- Throws:
java.io.IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classjava.io.InputStream
-
skip
public long skip(long n) throws java.io.IOException- Overrides:
skipin classjava.io.InputStream- Throws:
java.io.IOException
-