public class Value extends Object implements org.apache.hadoop.io.WritableComparable<Object>
BytesWritable
only this class is NOT resizable and DOES NOT
distinguish between the size of the sequence and the current capacity as BytesWritable
does. Hence its comparatively
'immutable'.Modifier and Type | Class and Description |
---|---|
static class |
Value.Comparator
A Comparator optimized for Value.
|
Modifier and Type | Field and Description |
---|---|
protected byte[] |
value |
Constructor and Description |
---|
Value()
Create a zero-size sequence.
|
Value(byte[] bytes)
Create a Value using the byte array as the initial value.
|
Value(byte[] bytes,
boolean copy) |
Value(byte[] newData,
int offset,
int length)
Set the value to a copy of the given byte range
|
Value(ByteBuffer bytes) |
Value(ByteBuffer bytes,
boolean copy) |
Value(Value ibw)
Set the new Value to a copy of the contents of the passed
ibw . |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(byte[] that)
Compares the bytes in this object to the specified byte array
|
int |
compareTo(Object right_obj)
Define the sort order of the BytesWritable.
|
void |
copy(byte[] b) |
boolean |
equals(Object right_obj) |
byte[] |
get()
Get the data from the BytesWritable.
|
int |
getSize() |
int |
hashCode() |
void |
readFields(DataInput in) |
void |
set(byte[] b) |
static byte[][] |
toArray(List<byte[]> array) |
String |
toString() |
void |
write(DataOutput out) |
public Value()
public Value(byte[] bytes)
bytes
- This array becomes the backing storage for the object.public Value(ByteBuffer bytes)
public Value(ByteBuffer bytes, boolean copy)
public Value(byte[] bytes, boolean copy)
public Value(Value ibw)
ibw
.ibw
- the value to set this Value to.public Value(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 copypublic byte[] get()
public void set(byte[] b)
b
- Use passed bytes as backing array for this instance.public void copy(byte[] b)
b
- copy bytespublic int getSize()
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
public int compareTo(Object right_obj)
compareTo
in interface Comparable<Object>
right_obj
- The other bytes writablepublic int compareTo(byte[] that)
public static byte[][] toArray(List<byte[]> array)
Copyright © 2011-2016 The Apache Software Foundation. All Rights Reserved.