public class BytesRefWritable extends Object implements org.apache.hadoop.io.Writable, Comparable<BytesRefWritable>
Modifier and Type | Field and Description |
---|---|
static BytesRefWritable |
ZeroBytesRefWritable |
Constructor and Description |
---|
BytesRefWritable()
Create a zero-size bytes.
|
BytesRefWritable(byte[] bytes)
Create a BytesRefWritable referenced to the given bytes.
|
BytesRefWritable(byte[] data,
int offset,
int len)
Create a BytesRefWritable referenced to one section of the given bytes.
|
BytesRefWritable(int length)
Create a BytesRefWritable with length bytes.
|
BytesRefWritable(LazyDecompressionCallback lazyDecompressData,
int offset,
int len)
Create a BytesRefWritable referenced to one section of the given bytes.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(BytesRefWritable other) |
boolean |
equals(Object right_obj) |
byte[] |
getBytesCopy()
Returns a copy of the underlying bytes referenced by this instance.
|
byte[] |
getData()
Returns the underlying bytes.
|
int |
getLength() |
int |
getStart() |
int |
hashCode() |
void |
readFields(DataInput in)
Always reuse the bytes array if length of bytes array is equal or greater
to the current record, otherwise create a new one.
|
void |
set(byte[] newData,
int offset,
int len)
readFields() will corrupt the array.
|
void |
set(LazyDecompressionCallback newData,
int offset,
int len)
readFields() will corrupt the array.
|
String |
toString() |
void |
write(DataOutput out) |
void |
writeDataTo(DataOutput out) |
public static BytesRefWritable ZeroBytesRefWritable
public BytesRefWritable()
public BytesRefWritable(int length)
public BytesRefWritable(byte[] bytes)
public BytesRefWritable(byte[] data, int offset, int len)
public BytesRefWritable(LazyDecompressionCallback lazyDecompressData, int offset, int len)
public byte[] getBytesCopy() throws IOException
IOException
public byte[] getData() throws IOException
IOException
public void set(byte[] newData, int offset, int len)
readFields(DataInput)
public void set(LazyDecompressionCallback newData, int offset, int len)
readFields(DataInput)
public void writeDataTo(DataOutput out) throws IOException
IOException
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
set(byte[], int, int)
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
public int compareTo(BytesRefWritable other)
compareTo
in interface Comparable<BytesRefWritable>
public int getLength()
public int getStart()
Copyright © 2017 The Apache Software Foundation. All rights reserved.