net.i2p.sam
Class SAMRawSession
java.lang.Object
net.i2p.sam.SAMMessageSession
net.i2p.sam.SAMRawSession
- Direct Known Subclasses:
- SAMv3RawSession
public class SAMRawSession
- extends SAMMessageSession
SAM RAW session class.
- Author:
- human
Method Summary |
protected void |
messageReceived(byte[] msg)
Handle a new received message |
boolean |
sendBytes(String dest,
byte[] data)
Send bytes through a SAM RAW session. |
protected void |
shutDown()
Do whatever is needed to shutdown the SAM session |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RAW_SIZE_MAX
public static final int RAW_SIZE_MAX
- See Also:
- Constant Field Values
recv
protected SAMRawReceiver recv
SAMRawSession
public SAMRawSession(String dest,
Properties props,
SAMRawReceiver recv)
throws IOException,
DataFormatException,
I2PSessionException
- Create a new SAM RAW session.
- Parameters:
dest
- Base64-encoded destination (private key)props
- Properties to setup the I2P sessionrecv
- Object that will receive incoming data
- Throws:
IOException
DataFormatException
I2PSessionException
SAMRawSession
public SAMRawSession(InputStream destStream,
Properties props,
SAMRawReceiver recv)
throws IOException,
DataFormatException,
I2PSessionException
- Create a new SAM RAW session.
- Parameters:
destStream
- Input stream containing the destination keysprops
- Properties to setup the I2P sessionrecv
- Object that will receive incoming data
- Throws:
IOException
DataFormatException
I2PSessionException
sendBytes
public boolean sendBytes(String dest,
byte[] data)
throws DataFormatException
- Send bytes through a SAM RAW session.
- Specified by:
sendBytes
in class SAMMessageSession
- Parameters:
data
- Bytes to be sentdest
- Destination
- Returns:
- True if the data was sent, false otherwise
- Throws:
DataFormatException
messageReceived
protected void messageReceived(byte[] msg)
- Description copied from class:
SAMMessageSession
- Handle a new received message
- Specified by:
messageReceived
in class SAMMessageSession
- Parameters:
msg
- Message payload
shutDown
protected void shutDown()
- Description copied from class:
SAMMessageSession
- Do whatever is needed to shutdown the SAM session
- Specified by:
shutDown
in class SAMMessageSession