public final class CompressedXContent
extends java.lang.Object
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 and Description |
---|
CompressedXContent(byte[] data) |
CompressedXContent(BytesReference data)
Create a
CompressedXContent out of a serialized ToXContent
that may already be compressed. |
CompressedXContent(java.lang.String str) |
CompressedXContent(ToXContent xcontent,
XContentType type,
ToXContent.Params params)
Create a
CompressedXContent out of a ToXContent instance. |
Modifier and Type | Method and Description |
---|---|
byte[] |
compressed()
Return the compressed bytes.
|
BytesReference |
compressedReference()
Return the compressed bytes as a
BytesReference . |
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
static CompressedXContent |
readCompressedString(StreamInput in) |
java.lang.String |
string() |
java.lang.String |
toString() |
byte[] |
uncompressed()
Return the uncompressed bytes.
|
void |
writeTo(StreamOutput out) |
public CompressedXContent(ToXContent xcontent, XContentType type, ToXContent.Params params) throws java.io.IOException
CompressedXContent
out of a ToXContent
instance.java.io.IOException
public CompressedXContent(BytesReference data) throws java.io.IOException
CompressedXContent
out of a serialized ToXContent
that may already be compressed.java.io.IOException
public CompressedXContent(byte[] data) throws java.io.IOException
java.io.IOException
public CompressedXContent(java.lang.String str) throws java.io.IOException
java.io.IOException
public byte[] compressed()
public BytesReference compressedReference()
BytesReference
.public byte[] uncompressed()
public java.lang.String string() throws java.io.IOException
java.io.IOException
public static CompressedXContent readCompressedString(StreamInput in) throws java.io.IOException
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
java.io.IOException
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object