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
ConstructorDescriptionCompressedXContent(byte[] data)
CompressedXContent(String str)
Create aCompressedXContent
out of a serializedToXContent
that 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 aCompressedXContent
out of aToXContent
instance. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Return the compressed bytes.Return the compressed bytes as aBytesReference
.boolean
int
hashCode()
static CompressedXContent
string()
toString()
Return the uncompressed bytes.void
writeTo(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 aCompressedXContent
out of aToXContent
instance.- Throws:
IOException
-
CompressedXContent
Create aCompressedXContent
out of a serializedToXContent
that 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
-