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
 
 public class FastInputStream extends DataInputInputStream Single threaded buffered InputStream Internal Solr use only, subject to change.
- 
- 
Field SummaryFields Modifier and Type Field Description protected byte[]bufprotected intendprotected InputStreaminprotected intposprotected longreadFromStream
 - 
Constructor SummaryConstructors Constructor Description FastInputStream(InputStream in)FastInputStream(InputStream in, byte[] tempBuffer, int start, int end)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()byte[]getBuffer()Returns the internal buffer used for cachingintgetEndInBuffer()Current end-of-data position within the internal buffer.intgetPositionInBuffer()Current position within the internal bufferintpeek()longposition()intread()intread(byte[] b, int off, int len)booleanreadBoolean()bytereadByte()charreadChar()doublereadDouble()floatreadFloat()voidreadFully(byte[] b)voidreadFully(byte[] b, int off, int len)intreadInt()StringreadLine()longreadLong()shortreadShort()intreadUnsignedByte()intreadUnsignedShort()StringreadUTF()intreadWrappedStream(byte[] target, int offset, int len)voidrefill()intskipBytes(int n)static FastInputStreamwrap(InputStream in)- 
Methods inherited from class org.apache.solr.common.util.DataInputInputStreamreadDirectByteBuffer
 - 
Methods inherited from class java.io.InputStreammark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
 
- 
 
- 
- 
- 
Field Detail- 
inprotected final InputStream in 
 - 
bufprotected final byte[] buf 
 - 
posprotected int pos 
 - 
endprotected int end 
 - 
readFromStreamprotected long readFromStream 
 
- 
 - 
Constructor Detail- 
FastInputStreampublic FastInputStream(InputStream in) 
 - 
FastInputStreampublic FastInputStream(InputStream in, byte[] tempBuffer, int start, int end) 
 
- 
 - 
Method Detail- 
wrappublic static FastInputStream wrap(InputStream in) 
 - 
readpublic int read() throws IOException- Specified by:
- readin class- InputStream
- Throws:
- IOException
 
 - 
peekpublic int peek() throws IOException- Throws:
- IOException
 
 - 
readUnsignedBytepublic int readUnsignedByte() throws IOException- Throws:
- IOException
 
 - 
readWrappedStreampublic int readWrappedStream(byte[] target, int offset, int len) throws IOException- Throws:
- IOException
 
 - 
positionpublic long position() 
 - 
refillpublic void refill() throws IOException- Throws:
- IOException
 
 - 
availablepublic int available() throws IOException- Overrides:
- availablein class- InputStream
- Throws:
- IOException
 
 - 
getBufferpublic byte[] getBuffer() Returns the internal buffer used for caching
 - 
getPositionInBufferpublic int getPositionInBuffer() Current position within the internal buffer
 - 
getEndInBufferpublic int getEndInBuffer() Current end-of-data position within the internal buffer. This is one past the last valid byte.
 - 
readpublic int read(byte[] b, int off, int len) throws IOException- Overrides:
- readin class- InputStream
- Throws:
- IOException
 
 - 
closepublic void close() throws IOException- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Overrides:
- closein class- InputStream
- Throws:
- IOException
 
 - 
readFullypublic void readFully(byte[] b) throws IOException- Throws:
- IOException
 
 - 
readFullypublic void readFully(byte[] b, int off, int len) throws IOException- Throws:
- IOException
 
 - 
skipBytespublic int skipBytes(int n) throws IOException- Throws:
- IOException
 
 - 
readBooleanpublic boolean readBoolean() throws IOException- Throws:
- IOException
 
 - 
readBytepublic byte readByte() throws IOException- Throws:
- IOException
 
 - 
readShortpublic short readShort() throws IOException- Throws:
- IOException
 
 - 
readUnsignedShortpublic int readUnsignedShort() throws IOException- Throws:
- IOException
 
 - 
readCharpublic char readChar() throws IOException- Throws:
- IOException
 
 - 
readIntpublic int readInt() throws IOException- Throws:
- IOException
 
 - 
readLongpublic long readLong() throws IOException- Throws:
- IOException
 
 - 
readFloatpublic float readFloat() throws IOException- Throws:
- IOException
 
 - 
readDoublepublic double readDouble() throws IOException- Throws:
- IOException
 
 - 
readLinepublic String readLine() throws IOException - Throws:
- IOException
 
 - 
readUTFpublic String readUTF() throws IOException - Throws:
- IOException
 
 
- 
 
-