|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdatarecord.DataRecord
public class DataRecord
For simplicity, all DataSource and DataSink classes use a single
representation for data records in their buffers.
This is it.
A DataRecord is a byte[] plus two scalars: the total number of
bytes actually stored in that array, plus the current offset (i.e.,
the offset to the first byte not already handed out, if a DataSource,
or the first not yet written, if a DataSink.
Note that the instance variables are all public. This makes it easier
to call various Java API methods that read/write things like files
and network connections. (Not to mention it avoids having to write
a slew of trivial getter/setter functions.)
Field Summary | |
---|---|
int |
capacity
The size of the byte[] called data. |
byte[] |
data
The data |
int |
length
The number of unconsumed bytes of user data remaining in the buffer. |
(package private) java.lang.Integer |
mapKey
An instance variable of what would normally be a local variable. |
int |
offset
An offset into the record. |
Constructor Summary | |
---|---|
DataRecord(int size)
Create the record and initialize to empty. |
Method Summary | |
---|---|
(package private) void |
reInit()
A method to initialize the portions of the DataRecord that may have changed if it has previously been used. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public byte[] data
public int capacity
public int length
public int offset
java.lang.Integer mapKey
Constructor Detail |
---|
DataRecord(int size)
Method Detail |
---|
void reInit()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |