verinec.netsim.util.net.sockets
Class BufferedSocketInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
java.io.BufferedInputStream
verinec.netsim.util.net.sockets.BufferedSocketInputStream
- All Implemented Interfaces:
- Closeable
public class BufferedSocketInputStream
- extends BufferedInputStream
A Buffered Input Stream that reads from a SocketInputStream.
- Version:
- $Revision: 47 $
- Author:
- Dominik Jungo
|
Method Summary |
void |
addPacket(TCPPacket packet)
adds a TCP Packet into the Inputstreams buffer |
int |
getAck()
gets the address of the last part of the buffer that can be acknowledged |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BufferedSocketInputStream
public BufferedSocketInputStream(SocketImpl impl)
throws IOException
- creates a BufferedSocketInputStream with a buffersize of
SocketOptions.SO_SNDBUF
- Parameters:
impl - a SocketImpl
- Throws:
IOException - if size <= 0
BufferedSocketInputStream
public BufferedSocketInputStream(SocketImpl impl,
int size)
throws IOException
- creates a BufferedSocketInputStream
- Parameters:
impl - a SocketImplsize - size of the buffer
- Throws:
IOException - if size <= 0
getAck
public int getAck()
- gets the address of the last part of the buffer that can be acknowledged
- Returns:
- the address of the last part of the buffer that can be acknowledged
addPacket
public void addPacket(TCPPacket packet)
throws NetSimException
- adds a TCP Packet into the Inputstreams buffer
- Parameters:
packet - a TCP Packet
- Throws:
NetSimException - if the packet can't be added to the buffer (the buffer is full)