public class Stream
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
PROPERTY_COMPRESS |
static int |
PROPERTY_MULTIPLEXING |
static int |
PROPERTY_PLAIN |
static int |
PROPERTY_PORT_FORWARDING |
static int |
PROPERTY_RELIABLE |
| Modifier and Type | Method and Description |
|---|---|
void |
closeChannel(int channel)
Close a new channel on multiplexing stream.
|
void |
closePortForwarding(int portForwarding)
Close a port forwarding.
|
java.io.OutputStream |
getOutputStream() |
java.io.OutputStream |
getOutputStream(int channel) |
int |
getStreamId() |
TransportInfo |
getTransportInfo()
Get tranport info of carrier stream.
|
StreamType |
getType()
Get the carrier stream type.
|
int |
openChannel(java.lang.String cookie)
Open a new channel on multiplexing stream.
|
int |
openPortForwarding(java.lang.String service,
PortForwardingProtocol protocol,
java.lang.String host,
java.lang.String port)
Open a port forwarding to remote service over multiplexing.
|
void |
pendChannel(int channel)
Request remote peer to pend channel data sending.
|
void |
resumeChannel(int channel)
Request remote peer to resume channel data sending.
|
int |
writeData(byte data)
Send outgoing data to remote peer.
|
int |
writeData(byte[] data)
Send outgoing data to remote peer.
|
int |
writeData(byte[] data,
int offset,
int len)
Send outgoing data to remote peer.
|
int |
writeData(int channel,
byte data)
Send outgoing data to remote peer.
|
int |
writeData(int channel,
byte[] data)
Send outgoing data to remote peer.
|
int |
writeData(int channel,
byte[] data,
int offset,
int len)
Send outgoing data to remote peer.
|
public static int PROPERTY_COMPRESS
public static int PROPERTY_PLAIN
public static int PROPERTY_RELIABLE
public static int PROPERTY_MULTIPLEXING
public static int PROPERTY_PORT_FORWARDING
public int getStreamId()
public StreamType getType()
public TransportInfo getTransportInfo() throws CarrierException
CarrierExceptionpublic int writeData(byte[] data,
int offset,
int len)
throws CarrierException
data - The outgoing data
offset The start offset
len The bytes to writeCarrierExceptionpublic int writeData(byte[] data)
throws CarrierException
data - The outgoing dataCarrierExceptionpublic int writeData(byte data)
throws CarrierException
data - The outgoing dataCarrierExceptionpublic java.io.OutputStream getOutputStream()
public java.io.OutputStream getOutputStream(int channel)
public int openChannel(java.lang.String cookie)
throws CarrierException
cookie - The application defined data passed to remote peerCarrierExceptionpublic void closeChannel(int channel)
throws CarrierException
channel - The channel ID to closeCarrierExceptionpublic int writeData(int channel,
byte[] data,
int offset,
int len)
throws CarrierException
channel - [in] The channel IDdata - [in] The outgoing data
offset [in] The start offset
len [in] The bytes to writeCarrierExceptionpublic int writeData(int channel,
byte[] data)
throws CarrierException
channel - [in] The channel IDdata - [in] The outgoing dataCarrierExceptionpublic int writeData(int channel,
byte data)
throws CarrierException
channel - [in] The channel IDdata - [in] The outgoing dataCarrierExceptionpublic void pendChannel(int channel)
throws CarrierException
channel - The channel IDCarrierExceptionpublic void resumeChannel(int channel)
throws CarrierException
channel - The channel IDCarrierExceptionpublic int openPortForwarding(java.lang.String service,
PortForwardingProtocol protocol,
java.lang.String host,
java.lang.String port)
throws CarrierException
service - The remote service nameprotocol - Port forwarding protocolhost - Local host or ip to binding
If host is null, port forwarding will bind to localhostport - Local port to binding, can not be nil.CarrierExceptionpublic void closePortForwarding(int portForwarding)
throws CarrierException
portForwarding - The portforwarding ID.CarrierException