|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jppf.utils.JPPFBuffer
public class JPPFBuffer
buffer for the data read from or written to a socket connection.
| Field Summary | |
|---|---|
byte[] |
buffer
The actual buffer, intended to contain a serialized object graph. |
int |
length
The length of the buffer. |
int |
pos
Current position in this buffer. |
| Constructor Summary | |
|---|---|
JPPFBuffer()
Initialize this buffer. |
|
JPPFBuffer(byte[] buffer,
int length)
Initialize this buffer with a specified buffer and buffer length. |
|
JPPFBuffer(String str)
Initialize this buffer with the specified String, using UTF-8 encoding. |
|
| Method Summary | |
|---|---|
String |
asString()
Transform this buffer into a string using UTF-8 encoding. |
byte[] |
getBuffer()
Get the buffered data. |
int |
getLength()
Get the length of the buffered data. |
int |
remaining()
Return the number of bytes available for writing in this buffer. |
int |
remainingFromPos()
Return the number of bytes available for reading in this buffer. |
void |
setBuffer(byte[] buffer)
Set the buffered data. |
void |
setLength(int length)
Set the length of the buffered data. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public byte[] buffer
public int length
public int pos
| Constructor Detail |
|---|
public JPPFBuffer()
public JPPFBuffer(String str)
str - the string whose contents will be put into this buffer.
public JPPFBuffer(byte[] buffer,
int length)
buffer - the buffer to use.length - the number of bytes to use in the buffer.| Method Detail |
|---|
public void setBuffer(byte[] buffer)
buffer - an array of bytes containing the data.public byte[] getBuffer()
public void setLength(int length)
length - the length as an int.public int getLength()
public int remaining()
public int remainingFromPos()
public String asString()
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||