|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.hunnysoft.jmime.ByteBuffer
Byte buffer structure.
The ByteBuffer class is used as a byte buffer structure
for various encoders and decoders.
The following code example shows how you can prepare input and output
buffers, where the input data is in the byte array myData:
ByteBuffer inBuf = new ByteBuffer();
inBuf.bytes = myData;
inBuf.pos = 0;
inBuf.endPos = myData.length;
outBuf = new ByteBuffer();
outBuf.bytes = new byte[2048];
outBuf.pos = 0;
outBuf.endPos = outBuf.bytes.length;
CharBuffer| Field Summary | |
byte[] |
bytes
Byte array that contains input data or that provides output buffer space. |
int |
endPos
Offset of the end of the buffer. |
int |
pos
Offset of the beginning of the buffer. |
| Constructor Summary | |
ByteBuffer()
|
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public byte[] bytes
public int pos
For an input buffer, this value is the offset of the beginning of the unconsumed data in the byte array. For an output buffer, this value is the offset of the beginning of the unused space in the byte array. Offsets are zero-based.
public int endPos
This value should be one larger than the offset of the last
valid byte position in bytes. For example, if
buf.bytes[last] is the last valid byte in the byte
array, then buf.endPos should be set to
last+1. Offsets are zero-based.
| Constructor Detail |
public ByteBuffer()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||