Package org.apache.solr.common.util
Class FastInputStream
java.lang.Object
java.io.InputStream
org.apache.solr.common.util.DataInputInputStream
org.apache.solr.common.util.FastInputStream
- All Implemented Interfaces:
Closeable,DataInput,AutoCloseable
Single threaded buffered InputStream Internal Solr use only, subject to change.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final byte[]protected intprotected final InputStreamprotected intprotected long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintvoidclose()byte[]Returns the internal buffer used for cachingintCurrent end-of-data position within the internal buffer.intCurrent position within the internal bufferintpeek()longposition()intread()intread(byte[] b, int off, int len) booleanbytereadByte()charreadChar()doublefloatvoidreadFully(byte[] b) voidreadFully(byte[] b, int off, int len) intreadInt()readLine()longreadLong()shortintintreadUTF()intreadWrappedStream(byte[] target, int offset, int len) voidrefill()intskipBytes(int n) static FastInputStreamwrap(InputStream in) Methods inherited from class org.apache.solr.common.util.DataInputInputStream
readDirectByteBufferMethods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Field Details
-
in
-
buf
protected final byte[] buf -
pos
protected int pos -
end
protected int end -
readFromStream
protected long readFromStream
-
-
Constructor Details
-
FastInputStream
-
FastInputStream
-
-
Method Details
-
wrap
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
peek
- Throws:
IOException
-
readUnsignedByte
- Throws:
IOException
-
readWrappedStream
- Throws:
IOException
-
position
public long position() -
refill
- Throws:
IOException
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
getBuffer
public byte[] getBuffer()Returns the internal buffer used for caching -
getPositionInBuffer
public int getPositionInBuffer()Current position within the internal buffer -
getEndInBuffer
public int getEndInBuffer()Current end-of-data position within the internal buffer. This is one past the last valid byte. -
read
- Overrides:
readin classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
readFully
- Throws:
IOException
-
readFully
- Throws:
IOException
-
skipBytes
- Throws:
IOException
-
readBoolean
- Throws:
IOException
-
readByte
- Throws:
IOException
-
readShort
- Throws:
IOException
-
readUnsignedShort
- Throws:
IOException
-
readChar
- Throws:
IOException
-
readInt
- Throws:
IOException
-
readLong
- Throws:
IOException
-
readFloat
- Throws:
IOException
-
readDouble
- Throws:
IOException
-
readLine
- Throws:
IOException
-
readUTF
- Throws:
IOException
-