public class TIOStreamTransport extends TEndpointTransport
| Modifier and Type | Field and Description |
|---|---|
protected java.io.InputStream |
inputStream_
Underlying inputStream
|
protected java.io.OutputStream |
outputStream_
Underlying outputStream
|
knownMessageSize, remainingMessageSize| Modifier | Constructor and Description |
|---|---|
protected |
TIOStreamTransport()
Subclasses can invoke the default constructor and then assign the input
streams in the open method.
|
|
TIOStreamTransport(java.io.InputStream is)
Input stream constructor, constructs an input only transport.
|
|
TIOStreamTransport(java.io.InputStream is,
java.io.OutputStream os)
Two-way stream constructor.
|
|
TIOStreamTransport(java.io.OutputStream os)
Output stream constructor, constructs an output only transport.
|
protected |
TIOStreamTransport(TConfiguration config)
Subclasses can invoke the default constructor and then assign the input
streams in the open method.
|
|
TIOStreamTransport(TConfiguration config,
java.io.InputStream is)
Input stream constructor, constructs an input only transport.
|
|
TIOStreamTransport(TConfiguration config,
java.io.InputStream is,
java.io.OutputStream os)
Two-way stream constructor.
|
|
TIOStreamTransport(TConfiguration config,
java.io.OutputStream os)
Output stream constructor, constructs an output only transport.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes both the input and output streams.
|
void |
flush()
Flushes the underlying output stream if not null.
|
boolean |
isOpen()
Queries whether the transport is open.
|
void |
open()
The streams must already be open.
|
int |
read(byte[] buf,
int off,
int len)
Reads from the underlying input stream if not null.
|
void |
write(byte[] buf,
int off,
int len)
Writes to the underlying output stream if not null.
|
checkReadBytesAvailable, countConsumedMessageBytes, getConfiguration, getMaxMessageSize, resetConsumedMessageSize, updateKnownMessageSizeconsumeBuffer, getBuffer, getBufferPosition, getBytesRemainingInBuffer, peek, read, readAll, write, writeprotected java.io.InputStream inputStream_
protected java.io.OutputStream outputStream_
protected TIOStreamTransport(TConfiguration config) throws TTransportException
TTransportExceptionprotected TIOStreamTransport()
throws TTransportException
TTransportExceptionpublic TIOStreamTransport(TConfiguration config, java.io.InputStream is) throws TTransportException
config - is - Input stream to read fromTTransportExceptionpublic TIOStreamTransport(java.io.InputStream is)
throws TTransportException
is - Input stream to read fromTTransportExceptionpublic TIOStreamTransport(TConfiguration config, java.io.OutputStream os) throws TTransportException
config - os - Output stream to write toTTransportExceptionpublic TIOStreamTransport(java.io.OutputStream os)
throws TTransportException
os - Output stream to write toTTransportExceptionpublic TIOStreamTransport(TConfiguration config, java.io.InputStream is, java.io.OutputStream os) throws TTransportException
config - is - Input stream to read fromos - Output stream to read fromTTransportExceptionpublic TIOStreamTransport(java.io.InputStream is,
java.io.OutputStream os)
throws TTransportException
is - Input stream to read fromos - Output stream to read fromTTransportExceptionpublic boolean isOpen()
TTransportisOpen in class TTransportpublic void open()
throws TTransportException
open in class TTransportTTransportException - if the transport could not be openedpublic void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class TTransportpublic int read(byte[] buf,
int off,
int len)
throws TTransportException
read in class TTransportbuf - Array to read intooff - Index to start reading atlen - Maximum number of bytes to readTTransportException - if there was an error reading datapublic void write(byte[] buf,
int off,
int len)
throws TTransportException
write in class TTransportbuf - The output data bufferoff - The offset to start writing fromlen - The number of bytes to writeTTransportException - if there was an error writing datapublic void flush()
throws TTransportException
flush in class TTransportTTransportException - if there was an error writing out data.