com.devexperts.io
Class BufferedInputPart
java.lang.Object
java.io.InputStream
com.devexperts.io.BufferedInput
com.devexperts.io.BufferedInputPart
- All Implemented Interfaces:
- Closeable, DataInput, ObjectInput
public final class BufferedInputPart
- extends BufferedInput
A size-delimited part of BufferedInput
for parsing of size-tagged packets.
Methods inherited from class com.devexperts.io.BufferedInput |
checkEOB, checkRewind, mark, mark, markSupported, needData, read, read, readBoolean, readByte, readByteArray, readChar, readCompactInt, readCompactLong, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readObject, readShort, readUnsignedByte, readUnsignedShort, readUTF, readUTFChar, readUTFString, reset, seek, skipBytes, throwEOFException, totalPosition |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BufferedInputPart
public BufferedInputPart()
BufferedInputPart
public BufferedInputPart(BufferedInput in,
long length)
setInput
public void setInput(BufferedInput in,
long length)
resetInput
public void resetInput()
close
public void close()
- Specified by:
close
in interface Closeable
- Specified by:
close
in interface ObjectInput
- Overrides:
close
in class InputStream
available
public int available()
throws IOException
- Specified by:
available
in interface ObjectInput
- Overrides:
available
in class BufferedInput
- Throws:
IOException
read
public int read(byte[] b,
int off,
int len)
throws IOException
- Specified by:
read
in interface ObjectInput
- Overrides:
read
in class BufferedInput
- Throws:
IOException
skip
public long skip(long n)
throws IOException
- Specified by:
skip
in interface ObjectInput
- Overrides:
skip
in class BufferedInput
- Throws:
IOException
rewind
public void rewind(long n)
- Description copied from class:
BufferedInput
- Rewinds specified number of bytes. The input cannot be rewound past the marked position.
- Specified by:
rewind
in class BufferedInput
- Parameters:
n
- the number of bytes to rewind
readData
protected int readData()
throws IOException
- Description copied from class:
BufferedInput
- This method is invoked when input methods need more bytes to read data.
This method shall make an attempt to read some bytes into the buffer.
This method returns number of bytes actually read or value
-1
if no bytes can be read because the end of the stream has been reached.
This method may block if needed.
This method is allowed to update buffer, position, limit and totalPositionBase fields as needed.
This method shall never throw an EOFException
.
- Specified by:
readData
in class BufferedInput
- Returns:
- the total number of bytes read into the buffer, or
-1
if there is no more data because the end of the stream has been reached
- Throws:
IOException
- if an I/O error occurs
Copyright © 2013 Devexperts. All Rights Reserved.