|
SourceForge Jpcap | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.OutputStream
net.sourceforge.jpcap.capture.PacketOutputStream
public abstract class PacketOutputStream
PacketOutputStream is an I/O stream used for sending Packets to the network, or dumping them to a tcpdump-formatted file, depending on how the stream was created.
The close() and flush() methods close and flush the output file respectively.
For a stream created for sending, they do nothing.
PacketCapture.captureTo(int, PacketOutputStream),
PacketCapture.getOutputStream(),
PacketCapture.getOutputStream(File)| Constructor Summary | |
|---|---|
protected |
PacketOutputStream()
Creates a new instance of PacketOutputStream |
| Method Summary | |
|---|---|
abstract long |
getFilePointer()
Return the current file position for the savefile, i.e. |
void |
write(byte[] buffer)
|
void |
write(byte[] buffer,
int offset,
int count)
|
void |
write(int b)
|
abstract void |
writePacket(Packet packet)
Write a packet, by either: sending it to the network, or dumping it to a tcpdump-formatted output file, depending on how the stream was created. |
| Methods inherited from class java.io.OutputStream |
|---|
close, flush |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected PacketOutputStream()
| Method Detail |
|---|
public abstract long getFilePointer()
throws IOException
writePacket(net.sourceforge.jpcap.net.Packet).
IOException - Savefile not open, output not a savefile, etc.
public void write(int b)
throws IOException
This implementation throws UnsupportedOperationException.
write in class OutputStreamIOException
public void write(byte[] buffer)
throws IOException
This implementation throws UnsupportedOperationException.
write in class OutputStreamIOException
public void write(byte[] buffer,
int offset,
int count)
throws IOException
This implementation throws UnsupportedOperationException.
write in class OutputStreamIOException
public abstract void writePacket(Packet packet)
throws IOException
Packet.setChecksums(),
so checksums &c are not the application's problem,
at least for packet classes which correctly
implement Packet.setChecksums().
packet - Packet to write.
IOException - Some I/O problem sending or dumping the packet.
|
Copyright © Patrick Charles & Jonas Lehmann, 2001; Esmond Pitt, 2008. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||