|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.io.ImmutableBytesWritable
public class ImmutableBytesWritable
A byte sequence that is usable as a key or value. Based on
BytesWritable
only this class is NOT resizable
and DOES NOT distinguish between the size of the seqeunce and the current
capacity as BytesWritable
does. Hence its
comparatively 'immutable'.
Nested Class Summary | |
---|---|
static class |
ImmutableBytesWritable.Comparator
A Comparator optimized for ImmutableBytesWritable. |
Constructor Summary | |
---|---|
ImmutableBytesWritable()
Create a zero-size sequence. |
|
ImmutableBytesWritable(byte[] bytes)
Create a ImmutableBytesWritable using the byte array as the initial value. |
|
ImmutableBytesWritable(byte[] newData,
int offset,
int length)
Set the value to a copy of the given byte range |
|
ImmutableBytesWritable(ImmutableBytesWritable ibw)
Set the new ImmutableBytesWritable to a copy of the contents of the passed ibw . |
Method Summary | |
---|---|
int |
compareTo(byte[] that)
|
int |
compareTo(Object right_obj)
Define the sort order of the BytesWritable. |
boolean |
equals(Object right_obj)
Are the two byte sequences equal? |
byte[] |
get()
Get the data from the BytesWritable. |
int |
getSize()
Get the current size of the buffer. |
int |
hashCode()
|
void |
readFields(DataInput in)
Reads the fields of this object from in . |
static byte[][] |
toArray(List<byte[]> array)
|
String |
toString()
Generate the stream of bytes as hex pairs separated by ' '. |
void |
write(DataOutput out)
Writes the fields of this object to out . |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ImmutableBytesWritable()
public ImmutableBytesWritable(byte[] bytes)
bytes
- This array becomes the backing storage for the object.public ImmutableBytesWritable(ImmutableBytesWritable ibw)
ibw
.
ibw
- the value to set this ImmutableBytesWritable to.public ImmutableBytesWritable(byte[] newData, int offset, int length)
newData
- the new values to copy inoffset
- the offset in newData to start atlength
- the number of bytes to copyMethod Detail |
---|
public byte[] get()
public int getSize()
public void readFields(DataInput in) throws IOException
Writable
in
. For efficiency,
implementations should attempt to re-use storage in the existing object
where possible.
readFields
in interface Writable
IOException
public void write(DataOutput out) throws IOException
Writable
out
.
write
in interface Writable
IOException
public int hashCode()
hashCode
in class Object
public int compareTo(Object right_obj)
compareTo
in interface Comparable
right_obj
- The other bytes writable
public int compareTo(byte[] that)
public boolean equals(Object right_obj)
equals
in class Object
public String toString()
toString
in class Object
public static byte[][] toArray(List<byte[]> array)
array
- List of byte [].
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |