Class CompressedXContent
- java.lang.Object
-
- org.elasticsearch.common.compress.CompressedXContent
-
public final class CompressedXContent extends java.lang.ObjectSimilar class to theStringclass 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
Constructors Constructor Description CompressedXContent(byte[] data)CompressedXContent(java.lang.String str)CompressedXContent(BytesReference data)Create aCompressedXContentout of a serializedToXContentthat may already be compressed.CompressedXContent(ToXContent xcontent, XContentType type, ToXContent.Params params)Create aCompressedXContentout of aToXContentinstance.
-
Method Summary
Modifier and Type Method Description byte[]compressed()Return the compressed bytes.BytesReferencecompressedReference()Return the compressed bytes as aBytesReference.booleanequals(java.lang.Object o)inthashCode()static CompressedXContentreadCompressedString(StreamInput in)java.lang.Stringstring()java.lang.StringtoString()byte[]uncompressed()Return the uncompressed bytes.voidwriteTo(StreamOutput out)
-
-
-
Constructor Detail
-
CompressedXContent
public CompressedXContent(ToXContent xcontent, XContentType type, ToXContent.Params params) throws java.io.IOException
Create aCompressedXContentout of aToXContentinstance.- Throws:
java.io.IOException
-
CompressedXContent
public CompressedXContent(BytesReference data) throws java.io.IOException
Create aCompressedXContentout of a serializedToXContentthat may already be compressed.- Throws:
java.io.IOException
-
CompressedXContent
public CompressedXContent(byte[] data) throws java.io.IOException- Throws:
java.io.IOException
-
CompressedXContent
public CompressedXContent(java.lang.String str) throws java.io.IOException- Throws:
java.io.IOException
-
-
Method Detail
-
compressed
public byte[] compressed()
Return the compressed bytes.
-
compressedReference
public BytesReference compressedReference()
Return the compressed bytes as aBytesReference.
-
uncompressed
public byte[] uncompressed()
Return the uncompressed bytes.
-
string
public java.lang.String string()
-
readCompressedString
public static CompressedXContent readCompressedString(StreamInput in) throws java.io.IOException
- Throws:
java.io.IOException
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
- Throws:
java.io.IOException
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-