|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.InputStream
org.jnetpcap.nio.JBufferInputStream
public class JBufferInputStream
IO InputStream class that reads data out of a JBuffer. This implementation supports all methods efficiently, including bulk transfers and the optional mark operation.
| Constructor Summary | |
|---|---|
JBufferInputStream(JBuffer in)
Creates a new input stream initialized to read data out of the supplied buffer. |
|
JBufferInputStream(JBuffer in,
int offset,
int length)
Creates a new input stream initialized to read data out fo the supplied buffer. |
|
| Method Summary | |
|---|---|
int |
available()
Number of bytes available for reading out of the buffer. |
void |
close()
Closes this input stream. |
void |
mark(int readlimit)
Sets a mark within the buffer where subsequent reset operation will revert back the position to. |
boolean |
markSupported()
Checks if mark method is supported on this stream. |
int |
read()
Reads 1 byte out of the underlying source buffer. |
int |
read(byte[] b)
Reads a block of data out of the source buffer. |
int |
read(byte[] b,
int off,
int len)
Reads a block of data out of the source buffer. |
void |
reset()
Resets the stream back to position where it was previously marked. |
long |
skip(long n)
Advances the position with the source buffer effectively skipping over specified number of bytes. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JBufferInputStream(JBuffer in)
in - source buffer to read data out of
public JBufferInputStream(JBuffer in,
int offset,
int length)
in - source buffer to read data out ofoffset - offset into the source buffer where to start readinglength - number of byte to read out of the buffer before signalining end of
stream| Method Detail |
|---|
public int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOException - Signals that an I/O exception has occurred.InputStream.read()
public int available()
throws java.io.IOException
available in class java.io.InputStreamjava.io.IOException - Signals that an I/O exception has occurred.
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in class java.io.InputStreamjava.io.IOException - Signals that an I/O exception has occurred.InputStream.close()
public int read(byte[] b,
int off,
int len)
throws java.io.IOException
read in class java.io.InputStreamb - buffer to store the block of data readoff - offset into the destination buffer where to store the block datalen - number of bytes to read as a block
java.io.IOException - Signals that an I/O exception has occurred.
public int read(byte[] b)
throws java.io.IOException
read in class java.io.InputStreamb - Buffer to store the block of data read. The length of read
operation is the size of the byte array.
java.io.IOException - Signals that an I/O exception has occurred.
public long skip(long n)
throws java.io.IOException
skip in class java.io.InputStreamn - of bytes to skip over
java.io.IOException - Signals that an I/O exception has occurred.public void mark(int readlimit)
mark in class java.io.InputStreamreadlimit - Maximum number of bytes expected to be read. This parameter is
ignored for source buffer operations since data does not need to
be buffered.public boolean markSupported()
markSupported in class java.io.InputStream
public void reset()
throws java.io.IOException
reset in class java.io.InputStreamjava.io.IOException - Signals that an I/O exception has occurred.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||