org.elasticsearch.common.compress
Class CompressedString
java.lang.Object
org.elasticsearch.common.compress.CompressedString
- All Implemented Interfaces:
- Streamable
public class CompressedString
- extends Object
- implements Streamable
CompressedString
public CompressedString(byte[] compressed)
- Constructor assuming the data provided is compressed (UTF8). It uses the provided
array without copying it.
CompressedString
public CompressedString(BytesReference data)
throws IOException
- Throws:
IOException
CompressedString
public CompressedString(byte[] data,
int offset,
int length)
throws IOException
- Constructs a new compressed string, assuming the bytes are UTF8, by copying it over.
- Parameters:
data
- The byte arrayoffset
- Offset into the byte arraylength
- The length of the data
- Throws:
IOException
CompressedString
public CompressedString(String str)
throws IOException
- Throws:
IOException
compressed
public byte[] compressed()
uncompressed
public byte[] uncompressed()
throws IOException
- Throws:
IOException
string
public String string()
throws IOException
- Throws:
IOException
readCompressedString
public static CompressedString readCompressedString(StreamInput in)
throws IOException
- Throws:
IOException
readFrom
public void readFrom(StreamInput in)
throws IOException
- Specified by:
readFrom
in interface Streamable
- Throws:
IOException
writeTo
public void writeTo(StreamOutput out)
throws IOException
- Specified by:
writeTo
in interface Streamable
- Throws:
IOException
equals
public boolean equals(Object o)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2009-2012. All Rights Reserved.