public class TMemoryBuffer extends TTransport
| Constructor | Description |
|---|---|
TMemoryBuffer(int size) |
Create a TMemoryBuffer with an initial buffer size of size.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
Closes the transport.
|
byte[] |
getArray() |
|
java.lang.String |
inspect() |
|
boolean |
isOpen() |
Queries whether the transport is open.
|
int |
length() |
|
void |
open() |
Opens the transport for reading/writing.
|
int |
read(byte[] buf,
int off,
int len) |
Reads up to len bytes into buffer buf, starting at offset off.
|
java.lang.String |
toString(java.lang.String enc) |
Output the contents of the memory buffer as a String, using the supplied
encoding
|
void |
write(byte[] buf,
int off,
int len) |
Writes up to len bytes from the buffer.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconsumeBuffer, flush, getBuffer, getBufferPosition, getBytesRemainingInBuffer, peek, readAll, writepublic TMemoryBuffer(int size)
public boolean isOpen()
TTransportisOpen in class TTransportpublic void open()
TTransportopen in class TTransportpublic void close()
TTransportclose in class TTransportpublic int read(byte[] buf,
int off,
int len)
TTransportread in class TTransportbuf - Array to read intooff - Index to start reading atlen - Maximum number of bytes to readpublic void write(byte[] buf,
int off,
int len)
TTransportwrite in class TTransportbuf - The output data bufferoff - The offset to start writing fromlen - The number of bytes to writepublic java.lang.String toString(java.lang.String enc)
throws java.io.UnsupportedEncodingException
enc - the encoding to usejava.io.UnsupportedEncodingExceptionpublic java.lang.String inspect()
public int length()
public byte[] getArray()