Class CompressedXContent
java.lang.Object
org.elasticsearch.common.compress.CompressedXContent
Similar class to the
String class except that it internally stores
data using a compressed representation in order to require less permanent
memory. Note that the compressed string might still sometimes need to be
decompressed in order to perform equality checks or to compute hash codes.-
Constructor Summary
ConstructorsConstructorDescriptionCompressedXContent(byte[] data)CompressedXContent(String str)Create aCompressedXContentout of a serializedToXContentthat may already be compressed.CompressedXContent(org.elasticsearch.common.xcontent.ToXContent xcontent, org.elasticsearch.common.xcontent.XContentType type, org.elasticsearch.common.xcontent.ToXContent.Params params)Create aCompressedXContentout of aToXContentinstance. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]Return the compressed bytes.Return the compressed bytes as aBytesReference.booleaninthashCode()static CompressedXContentstring()toString()Return the uncompressed bytes.voidwriteTo(StreamOutput out)
-
Constructor Details
-
CompressedXContent
public CompressedXContent(org.elasticsearch.common.xcontent.ToXContent xcontent, org.elasticsearch.common.xcontent.XContentType type, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOExceptionCreate aCompressedXContentout of aToXContentinstance.- Throws:
IOException
-
CompressedXContent
Create aCompressedXContentout of a serializedToXContentthat may already be compressed.- Throws:
IOException
-
CompressedXContent
- Throws:
IOException
-
CompressedXContent
- Throws:
IOException
-
-
Method Details
-
compressed
public byte[] compressed()Return the compressed bytes. -
compressedReference
Return the compressed bytes as aBytesReference. -
uncompressed
Return the uncompressed bytes. -
string
-
readCompressedString
- Throws:
IOException
-
writeTo
- Throws:
IOException
-
equals
-
hashCode
public int hashCode() -
toString
-