org.elasticsearch.common.compress
Class CompressedString

java.lang.Object
  extended by org.elasticsearch.common.compress.CompressedString
All Implemented Interfaces:
Streamable

public class CompressedString
extends Object
implements Streamable


Constructor Summary
CompressedString(byte[] compressed)
          Constructor assuming the data provided is compressed (UTF8).
CompressedString(byte[] data, int offset, int length)
          Constructs a new compressed string, assuming the bytes are UTF8, by copying it over.
CompressedString(BytesReference data)
           
CompressedString(String str)
           
 
Method Summary
 byte[] compressed()
           
 boolean equals(Object o)
           
 int hashCode()
           
static CompressedString readCompressedString(StreamInput in)
           
 void readFrom(StreamInput in)
           
 String string()
           
 String toString()
           
 byte[] uncompressed()
           
 void writeTo(StreamOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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 array
offset - Offset into the byte array
length - The length of the data
Throws:
IOException

CompressedString

public CompressedString(String str)
                 throws IOException
Throws:
IOException
Method Detail

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.