Class CompressedXContent

java.lang.Object
org.opensearch.common.compress.CompressedXContent

@PublicApi(since="1.0.0") public final class CompressedXContent extends Object
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.
Opensearch.api:
  • Constructor Details

    • CompressedXContent

      public CompressedXContent(org.opensearch.core.xcontent.ToXContent xcontent, org.opensearch.core.xcontent.ToXContent.Params params) throws IOException
      Create a CompressedXContent out of a ToXContent instance.
      Throws:
      IOException
    • CompressedXContent

      public CompressedXContent(org.opensearch.core.common.bytes.BytesReference data) throws IOException
      Create a CompressedXContent out of a serialized ToXContent that may already be compressed.
      Throws:
      IOException
    • CompressedXContent

      public CompressedXContent(byte[] data) throws IOException
      Throws:
      IOException
    • CompressedXContent

      public CompressedXContent(String str) throws IOException
      Throws:
      IOException
  • Method Details

    • compressed

      public byte[] compressed()
      Return the compressed bytes.
    • compressedReference

      public org.opensearch.core.common.bytes.BytesReference compressedReference()
      Return the compressed bytes as a BytesReference.
    • uncompressed

      public org.opensearch.core.common.bytes.BytesReference uncompressed()
      Return the uncompressed bytes.
    • string

      public String string()
    • readCompressedString

      public static CompressedXContent readCompressedString(org.opensearch.core.common.io.stream.StreamInput in) throws IOException
      Throws:
      IOException
    • writeTo

      public void writeTo(org.opensearch.core.common.io.stream.StreamOutput out) throws IOException
      Throws:
      IOException
    • writeVerifiableTo

      public void writeVerifiableTo(BufferedChecksumStreamOutput out) throws IOException
      Throws:
      IOException
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object