| java.lang.Object org.apache.lucene.index.Payload
Constructor Summary | |
public | Payload() Creates an empty payload and does not allocate a byte array. | public | Payload(byte[] data) Creates a new payload with the the given array as data.
A reference to the passed-in array is held, i. | public | Payload(byte[] data, int offset, int length) Creates a new payload with the the given array as data. |
Method Summary | |
public byte | byteAt(int index) Returns the byte at the given index. | public Object | clone() Clones this payload by creating a copy of the underlying
byte array. | public void | copyTo(byte[] target, int targetOffset) Copies the payload data to a byte array. | public byte[] | getData() Returns a reference to the underlying byte array
that holds this payloads data. | public int | getOffset() | public int | length() Returns the length of the payload data. | public void | setData(byte[] data) Sets this payloads data. | public void | setData(byte[] data, int offset, int length) Sets this payloads data. | public byte[] | toByteArray() Allocates a new byte array, copies the payload data into it and returns it. |
data | protected byte[] data(Code) | | the byte array containing the payload data
|
length | protected int length(Code) | | the length of the payload data
|
offset | protected int offset(Code) | | the offset within the byte array
|
Payload | public Payload()(Code) | | Creates an empty payload and does not allocate a byte array.
|
Payload | public Payload(byte[] data)(Code) | | Creates a new payload with the the given array as data.
A reference to the passed-in array is held, i. e. no
copy is made.
Parameters: data - the data of this payload |
Payload | public Payload(byte[] data, int offset, int length)(Code) | | Creates a new payload with the the given array as data.
A reference to the passed-in array is held, i. e. no
copy is made.
Parameters: data - the data of this payload Parameters: offset - the offset in the data byte array Parameters: length - the length of the data |
byteAt | public byte byteAt(int index)(Code) | | Returns the byte at the given index.
|
clone | public Object clone()(Code) | | Clones this payload by creating a copy of the underlying
byte array.
|
copyTo | public void copyTo(byte[] target, int targetOffset)(Code) | | Copies the payload data to a byte array.
Parameters: target - the target byte array Parameters: targetOffset - the offset in the target byte array |
getData | public byte[] getData()(Code) | | Returns a reference to the underlying byte array
that holds this payloads data.
|
getOffset | public int getOffset()(Code) | | Returns the offset in the underlying byte array
|
length | public int length()(Code) | | Returns the length of the payload data.
|
setData | public void setData(byte[] data)(Code) | | Sets this payloads data.
A reference to the passed-in array is held, i. e. no
copy is made.
|
setData | public void setData(byte[] data, int offset, int length)(Code) | | Sets this payloads data.
A reference to the passed-in array is held, i. e. no
copy is made.
|
toByteArray | public byte[] toByteArray()(Code) | | Allocates a new byte array, copies the payload data into it and returns it.
|
|
|