class SAMRawSession extends SAMMessageSession
SAMMessageSession.SAMMessageSessionHandler
Modifier and Type | Field and Description |
---|---|
static int |
RAW_SIZE_MAX |
protected SAMRawReceiver |
recv |
_log
Constructor and Description |
---|
SAMRawSession(InputStream destStream,
Properties props,
SAMRawReceiver recv)
Create a new SAM RAW session.
|
SAMRawSession(String dest,
Properties props,
SAMRawReceiver recv)
Create a new SAM RAW session.
|
Modifier and Type | Method and Description |
---|---|
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
|
close, getDestination, getI2PSession, sendBytesThroughMessageSession
public static final int RAW_SIZE_MAX
protected SAMRawReceiver recv
public SAMRawSession(String dest, Properties props, SAMRawReceiver recv) throws IOException, DataFormatException, I2PSessionException
dest
- Base64-encoded destination and private keys (same format as PrivateKeyFile)props
- Properties to setup the I2P sessionrecv
- Object that will receive incoming dataIOException
DataFormatException
I2PSessionException
public SAMRawSession(InputStream destStream, Properties props, SAMRawReceiver recv) throws IOException, DataFormatException, I2PSessionException
destStream
- Input stream containing the destination and private keys (same format as PrivateKeyFile)props
- Properties to setup the I2P sessionrecv
- Object that will receive incoming dataIOException
DataFormatException
I2PSessionException
public boolean sendBytes(String dest, byte[] data) throws DataFormatException
sendBytes
in class SAMMessageSession
data
- Bytes to be sentdest
- DestinationDataFormatException
protected void messageReceived(byte[] msg)
SAMMessageSession
messageReceived
in class SAMMessageSession
msg
- Message payloadprotected void shutDown()
SAMMessageSession
shutDown
in class SAMMessageSession