public final class CompressedXContent extends 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(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(Object o) |
int |
hashCode() |
static CompressedXContent |
readCompressedString(StreamInput in) |
String |
string() |
String |
toString() |
byte[] |
uncompressed()
Return the uncompressed bytes.
|
void |
writeTo(StreamOutput out) |
public CompressedXContent(ToXContent xcontent, XContentType type, ToXContent.Params params) throws IOException
CompressedXContent out of a ToXContent instance.IOExceptionpublic CompressedXContent(BytesReference data) throws IOException
CompressedXContent out of a serialized ToXContent
that may already be compressed.IOExceptionpublic CompressedXContent(byte[] data)
throws IOException
IOExceptionpublic CompressedXContent(String str) throws IOException
IOExceptionpublic byte[] compressed()
public BytesReference compressedReference()
BytesReference.public byte[] uncompressed()
public String string() throws IOException
IOExceptionpublic static CompressedXContent readCompressedString(StreamInput in) throws IOException
IOExceptionpublic void writeTo(StreamOutput out) throws IOException
IOExceptionCopyright © 2009–2016. All rights reserved.