|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.io.InputStream
org.jppf.io.ByteBufferInputStream
public class ByteBufferInputStream
Implementation of an input stream backed by a ByteBuffer.
| Constructor Summary | |
|---|---|
ByteBufferInputStream(ByteBuffer buffer)
Initialize this stream to read from the specified byte buffer. |
|
ByteBufferInputStream(ByteBuffer buffer,
boolean flip)
Initialize this stream to read from the specified byte buffer. |
|
| Method Summary | |
|---|---|
int |
available()
Get the number of bytes that can still be read from this stream without blocking. |
void |
close()
Close this input stream. |
void |
mark(int readlimit)
Marks the current position in this input stream. |
boolean |
markSupported()
Tests if this input stream supports the mark and reset methods. |
int |
read()
Read one byte from |
int |
read(byte[] b)
|
int |
read(byte[] b,
int off,
int len)
|
void |
reset()
Repositions this stream to the position at the time the mark method was last called on this input stream. |
long |
skip(long n)
Skips over and discards n bytes of data from this input stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ByteBufferInputStream(ByteBuffer buffer)
buffer - the buffer to read from.
public ByteBufferInputStream(ByteBuffer buffer,
boolean flip)
buffer - the buffer to read from.flip - if true, then the buffer is flipped.| Method Detail |
|---|
public int read()
throws IOException
read in class InputStream-1 if the end of the stream is reached.
IOException - if an I/O error occurs.InputStream.read()
public int available()
throws IOException
available in class InputStreamIOException - if an I/O error occurs.InputStream.available()
public void close()
throws IOException
close in interface Closeableclose in class InputStreamIOException - if an I/O error occurs.InputStream.close()public void mark(int readlimit)
mark in class InputStreamreadlimit - the maximum limit of bytes that can be read before the mark position becomes invalid.InputStream.mark(int)public boolean markSupported()
mark and reset methods.
markSupported in class InputStreamtrue if this stream instance supports the mark and reset methods, false otherwise.InputStream.markSupported()
public int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamb - the buffer into which the data is read.off - the start offset in array b at which the data is written.len - the maximum number of bytes to read.
-1 if the end of the stream has been reached.
IOException - if an I/O error occurs.InputStream.read(byte[], int, int)
public int read(byte[] b)
throws IOException
read in class InputStreamb - the buffer into which the data is read.
-1 if the end of the stream has been reached.
IOException - if an I/O error occurs.InputStream.read(byte[])
public void reset()
throws IOException
mark method was last called on this input stream.
reset in class InputStreamIOException - if this stream has not been marked or if the mark has been invalidated.InputStream.reset()
public long skip(long n)
throws IOException
n bytes of data from this input stream.
skip in class InputStreamn - the number of bytes to be skipped.
IOException - if an I/O error occurs.InputStream.skip(long)
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||