Class ReadAheadBufferedStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.mariadb.jdbc.internal.io.input.ReadAheadBufferedStream
- All Implemented Interfaces:
Closeable, AutoCloseable
Permit to buffer socket data, reading not only asked bytes, but available number of bytes when
possible.
-
Field Summary
Fields inherited from class FilterInputStream
in -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class FilterInputStream
mark, readMethods inherited from class InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
ReadAheadBufferedStream
-
-
Method Details
-
read
Reading one byte from cache of socket if needed.- Overrides:
readin classFilterInputStream- Returns:
- byte value
- Throws:
IOException- if socket reading error.
-
read
Returing byte array, from cache of reading socket if needed.- Overrides:
readin classFilterInputStream- Parameters:
externalBuf- buffer to filloff- offsetlen- length to read- Returns:
- number of added bytes
- Throws:
IOException- if exception during socket reading
-
skip
- Overrides:
skipin classFilterInputStream- Throws:
IOException
-
available
- Overrides:
availablein classFilterInputStream- Throws:
IOException
-
reset
- Overrides:
resetin classFilterInputStream- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classFilterInputStream
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterInputStream- Throws:
IOException
-