Class BytesArray

java.lang.Object
org.elasticsearch.common.bytes.AbstractBytesReference
org.elasticsearch.common.bytes.BytesArray
All Implemented Interfaces:
java.lang.Comparable<BytesReference>, BytesReference, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentFragment

public final class BytesArray
extends AbstractBytesReference
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent

    org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params
  • Field Summary

    Fields
    Modifier and Type Field Description
    static BytesArray EMPTY  

    Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent

    EMPTY_PARAMS
  • Constructor Summary

    Constructors
    Constructor Description
    BytesArray​(byte[] bytes)  
    BytesArray​(byte[] bytes, int offset, int length)  
    BytesArray​(java.lang.String bytes)  
    BytesArray​(org.apache.lucene.util.BytesRef bytesRef)  
    BytesArray​(org.apache.lucene.util.BytesRef bytesRef, boolean deepCopy)  
  • Method Summary

    Modifier and Type Method Description
    byte[] array()  
    boolean equals​(java.lang.Object other)  
    byte get​(int index)
    Returns the byte at the specified index.
    int hashCode()  
    int length()
    The length.
    int offset()  
    long ramBytesUsed()
    The amount of memory used by this BytesReference
    BytesReference slice​(int from, int length)
    Slice the bytes from the from index up to length.
    StreamInput streamInput()
    A stream input of the bytes.
    org.apache.lucene.util.BytesRef toBytesRef()
    Converts to Lucene BytesRef.
    void writeTo​(java.io.OutputStream os)
    Writes the bytes directly to the output stream.

    Methods inherited from class org.elasticsearch.common.bytes.AbstractBytesReference

    compareTo, getInt, indexOf, iterator, toXContent, utf8ToString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment

    isFragment
  • Field Details

  • Constructor Details

    • BytesArray

      public BytesArray​(java.lang.String bytes)
    • BytesArray

      public BytesArray​(org.apache.lucene.util.BytesRef bytesRef)
    • BytesArray

      public BytesArray​(org.apache.lucene.util.BytesRef bytesRef, boolean deepCopy)
    • BytesArray

      public BytesArray​(byte[] bytes)
    • BytesArray

      public BytesArray​(byte[] bytes, int offset, int length)
  • Method Details

    • get

      public byte get​(int index)
      Description copied from interface: BytesReference
      Returns the byte at the specified index. Need to be between 0 and length.
    • length

      public int length()
      Description copied from interface: BytesReference
      The length.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class AbstractBytesReference
    • equals

      public boolean equals​(java.lang.Object other)
      Overrides:
      equals in class AbstractBytesReference
    • slice

      public BytesReference slice​(int from, int length)
      Description copied from interface: BytesReference
      Slice the bytes from the from index up to length.
    • array

      public byte[] array()
    • offset

      public int offset()
    • toBytesRef

      public org.apache.lucene.util.BytesRef toBytesRef()
      Description copied from interface: BytesReference
      Converts to Lucene BytesRef.
    • ramBytesUsed

      public long ramBytesUsed()
      Description copied from interface: BytesReference
      The amount of memory used by this BytesReference
    • streamInput

      public StreamInput streamInput()
      Description copied from interface: BytesReference
      A stream input of the bytes.
      Specified by:
      streamInput in interface BytesReference
      Overrides:
      streamInput in class AbstractBytesReference
    • writeTo

      public void writeTo​(java.io.OutputStream os) throws java.io.IOException
      Description copied from interface: BytesReference
      Writes the bytes directly to the output stream.
      Specified by:
      writeTo in interface BytesReference
      Overrides:
      writeTo in class AbstractBytesReference
      Throws:
      java.io.IOException