java.lang.Object
net.i2p.sam.client.SAMStreamSink.Sink
- Enclosing class:
SAMStreamSink
One open SAM session receiving messages.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanWhether the session has been closed.private final StringThe SAM connection id.private longWhen the last message arrived.private final OutputStreamStream for sending through this session.private final StringThe remote destination, for datagram modes.private final longWhen the session opened.Constructor Summary
Method Summary
Field Details
_connectionId
The SAM connection id._remoteDestination
The remote destination, for datagram modes._closed
private volatile boolean _closedWhether the session has been closed._started
private final long _startedWhen the session opened._lastReceivedOn
private long _lastReceivedOnWhen the last message arrived._out
Stream for sending through this session.
Constructor Details
Sink
Opens the sink file and starts the connection lifetime statistics.- Parameters:
conId- connection id, names the sink file and the statsremDest- remote destination name recorded in the stats- Throws:
IOException- if the sink file cannot be created or opened
Method Details
getConnectionId
getDestination
Remote destination of the stream.- Returns:
- the remote destination string reported when this connection was established, which is used only for logging
closed
public void closed()Marks the sink closed and closes its output file.received
public void received(byte[] data, int offset, int len) Appends incoming data to the sink file.- Parameters:
data- the received bytesoffset- start of the data to write within datalen- number of bytes to write from offset