|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.thrift.transport.TTransport
public abstract class TTransport
Generic class that encapsulates the I/O layer. This is basically a thin wrapper around the combined functionality of Java input/output streams.
| Constructor Summary | |
|---|---|
TTransport()
|
|
| Method Summary | |
|---|---|
abstract void |
close()
Closes the transport. |
void |
flush()
Flush any pending data out of a transport buffer. |
abstract boolean |
isOpen()
Queries whether the transport is open. |
abstract void |
open()
Opens the transport for reading/writing. |
boolean |
peek()
Is there more data to be read? |
abstract int |
read(byte[] buf,
int off,
int len)
Reads up to len bytes into buffer buf, starting att offset off. |
int |
readAll(byte[] buf,
int off,
int len)
Guarantees that all of len bytes are actually read off the transport. |
void |
write(byte[] buf)
Writes the buffer to the output |
abstract void |
write(byte[] buf,
int off,
int len)
Writes up to len bytes from the buffer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TTransport()
| Method Detail |
|---|
public abstract boolean isOpen()
public boolean peek()
public abstract void open()
throws TTransportException
TTransportException - if the transport could not be openedpublic abstract void close()
public abstract int read(byte[] buf,
int off,
int len)
throws TTransportException
buf - Array to read intooff - Index to start reading atlen - Maximum number of bytes to read
TTransportException - if there was an error reading data
public int readAll(byte[] buf,
int off,
int len)
throws TTransportException
buf - Array to read intooff - Index to start reading atlen - Maximum number of bytes to read
TTransportException - if there was an error reading data
public void write(byte[] buf)
throws TTransportException
buf - The output data buffer
TTransportException - if an error occurs writing data
public abstract void write(byte[] buf,
int off,
int len)
throws TTransportException
buf - The output data bufferoff - The offset to start writing fromlen - The number of bytes to write
TTransportException - if there was an error writing data
public void flush()
throws TTransportException
TTransportException - if there was an error writing out data.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||