|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
jnetpcap.capture.CaptureInputStream
public class CaptureInputStream
A CaptureInputStream deserializes CapturePackets into DeserializedPacket objects previously written using a CaptureOutputStream. DeserializedPacket interface is a subclass of CapturePacket which adds several new methods that contain information about the serialization process.
Here is an example:
FileOutputStream fos = new FileOutputStream("test.stream");
CaptureOutputStream cos = new CaptureOutputStream(fos);
CapturePacket packet = // gotten from live network or file
cos.writePacket(packet);
cos.close();
FileInputStream fis = new FileInputStream("test.stream");
CaptureInputStream cis = new CaptureInputStream(fis);
packet = cis.readPacket();
cis.close();
| Constructor Summary | |
|---|---|
CaptureInputStream(java.io.InputStream in)
Creates an ObjectInputStream that reads from the specified InputStream. |
|
| Method Summary | |
|---|---|
int |
available()
|
void |
close()
|
void |
mark(int readlimit)
|
boolean |
markSupported()
|
int |
read()
|
int |
read(byte[] b)
|
int |
read(byte[] b,
int off,
int len)
|
DeserializedPacket |
readPacket()
Read and return a StreamPacket object. |
void |
reset()
|
long |
skip(long n)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CaptureInputStream(java.io.InputStream in)
throws java.io.IOException
in - input stream to read from
java.io.IOException - any usual I/O errors| Method Detail |
|---|
public int available()
throws java.io.IOException
available in class java.io.InputStreamjava.io.IOException
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in class java.io.InputStreamjava.io.IOExceptionpublic void mark(int readlimit)
mark in class java.io.InputStreampublic boolean markSupported()
markSupported in class java.io.InputStream
public int read(byte[] b,
int off,
int len)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOException
public int read(byte[] b)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOException
public void reset()
throws java.io.IOException
reset in class java.io.InputStreamjava.io.IOException
public long skip(long n)
throws java.io.IOException
skip in class java.io.InputStreamjava.io.IOException
public int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOException
public DeserializedPacket readPacket()
throws java.io.IOException
CapturePacketInput
readPacket in interface CapturePacketInputjava.io.IOException - if any of the usual InputOutput related exceptions occur
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||