public class BytesRefWritable extends java.lang.Object implements java.lang.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(java.lang.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(java.io.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.
|
java.lang.String |
toString() |
void |
write(java.io.DataOutput out) |
void |
writeDataTo(java.io.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 java.io.IOException
java.io.IOException
public byte[] getData() throws java.io.IOException
java.io.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(java.io.DataOutput out) throws java.io.IOException
java.io.IOException
public void readFields(java.io.DataInput in) throws java.io.IOException
java.io.IOException
set(byte[], int, int)
public void write(java.io.DataOutput out) throws java.io.IOException
java.io.IOException
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public int compareTo(BytesRefWritable other)
compareTo
in interface java.lang.Comparable<BytesRefWritable>
public boolean equals(java.lang.Object right_obj)
equals
in class java.lang.Object
public int getLength()
public int getStart()
Copyright © 2012 The Apache Software Foundation