Class DataBufferedInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
uk.ac.starlink.util.DataBufferedInputStream
- All Implemented Interfaces:
Closeable, DataInput, AutoCloseable
InputStream which provides buffering and an efficient DataInput
implementation.
It can be much more efficient than layering a DataInputStream on top of
a BufferedInputStream.
- Since:
- 1 Mar 2022
- Author:
- Mark Taylor
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault buffer size 8192, same as java.io.BufferedInputStream.Fields inherited from class FilterInputStream
in -
Constructor Summary
ConstructorsConstructorDescriptionConstructs an instance with a default buffer size.DataBufferedInputStream(InputStream in, int size) Constructs an instance with a given buffer size. -
Method Summary
Modifier and TypeMethodDescriptionintvoidmark(int limit) booleanReturns false;intread()intread(byte[] b) intread(byte[] b, int off, int len) booleanbytereadByte()charreadChar()doublefloatvoidreadFully(byte[] b) voidreadFully(byte[] b, int off, int len) intreadInt()readLine()Deprecated.longreadLong()shortintintreadUTF()voidreset()longskip(long n) intskipBytes(int n) Methods inherited from class FilterInputStream
closeMethods inherited from class InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Field Details
-
DEFAULT_BUFFER_SIZE
public static final int DEFAULT_BUFFER_SIZEDefault buffer size 8192, same as java.io.BufferedInputStream.- See Also:
-
-
Constructor Details
-
DataBufferedInputStream
Constructs an instance with a default buffer size.- Parameters:
in- base input stream
-
DataBufferedInputStream
Constructs an instance with a given buffer size.- Parameters:
in- base input streamsize- buffer length in bytes
-
-
Method Details
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classFilterInputStream- Throws:
IOException
-
available
- Overrides:
availablein classFilterInputStream- Throws:
IOException
-
markSupported
-
mark
public void mark(int limit) - Overrides:
markin classFilterInputStream
-
reset
- Overrides:
resetin classFilterInputStream- Throws:
IOException
-
readBoolean
- Specified by:
readBooleanin interfaceDataInput- Throws:
IOException
-
readByte
- Specified by:
readBytein interfaceDataInput- Throws:
IOException
-
readUnsignedByte
- Specified by:
readUnsignedBytein interfaceDataInput- Throws:
IOException
-
readShort
- Specified by:
readShortin interfaceDataInput- Throws:
IOException
-
readUnsignedShort
- Specified by:
readUnsignedShortin interfaceDataInput- Throws:
IOException
-
readChar
- Specified by:
readCharin interfaceDataInput- Throws:
IOException
-
readInt
- Specified by:
readIntin interfaceDataInput- Throws:
IOException
-
readLong
- Specified by:
readLongin interfaceDataInput- Throws:
IOException
-
readFloat
- Specified by:
readFloatin interfaceDataInput- Throws:
IOException
-
readDouble
- Specified by:
readDoublein interfaceDataInput- Throws:
IOException
-
readFully
- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
readFully
- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
readLine
Deprecated.This method is deprecated and unsupported.- Specified by:
readLinein interfaceDataInput- Throws:
UnsupportedOperationException- alwaysIOException
-
readUTF
- Specified by:
readUTFin interfaceDataInput- Throws:
IOException
-
skipBytes
- Specified by:
skipBytesin interfaceDataInput- Throws:
IOException
-