Class AbstractBytesReference

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

public abstract class AbstractBytesReference extends Object implements BytesReference
  • 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 inherited from interface org.elasticsearch.common.xcontent.ToXContent

    EMPTY_PARAMS
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    boolean
    equals(Object other)
     
    int
    getInt(int index)
    Returns the integer read from the 4 bytes (BE) starting at the given index.
    int
     
    int
    indexOf(byte marker, int from)
    Finds the index of the first occurrence of the given marker between within the given bounds.
    org.apache.lucene.util.BytesRefIterator
    Returns a BytesRefIterator for this BytesReference.
    A stream input of the bytes.
    org.elasticsearch.common.xcontent.XContentBuilder
    toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
     
    Interprets the referenced bytes as UTF8 bytes, returning the resulting string
    void
    Writes the bytes directly to the output stream.

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.elasticsearch.common.bytes.BytesReference

    array, arrayOffset, get, hasArray, length, ramBytesUsed, slice, toBytesRef

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

    isFragment
  • Constructor Details

    • AbstractBytesReference

      public AbstractBytesReference()
  • Method Details

    • getInt

      public int getInt(int index)
      Description copied from interface: BytesReference
      Returns the integer read from the 4 bytes (BE) starting at the given index.
      Specified by:
      getInt in interface BytesReference
    • indexOf

      public int indexOf(byte marker, int from)
      Description copied from interface: BytesReference
      Finds the index of the first occurrence of the given marker between within the given bounds.
      Specified by:
      indexOf in interface BytesReference
      Parameters:
      marker - marker byte to search
      from - lower bound for the index to check (inclusive)
      Returns:
      first index of the marker or -1 if not found
    • streamInput

      public StreamInput streamInput() throws IOException
      Description copied from interface: BytesReference
      A stream input of the bytes.
      Specified by:
      streamInput in interface BytesReference
      Throws:
      IOException
    • writeTo

      public void writeTo(OutputStream os) throws IOException
      Description copied from interface: BytesReference
      Writes the bytes directly to the output stream.
      Specified by:
      writeTo in interface BytesReference
      Throws:
      IOException
    • utf8ToString

      public String utf8ToString()
      Description copied from interface: BytesReference
      Interprets the referenced bytes as UTF8 bytes, returning the resulting string
      Specified by:
      utf8ToString in interface BytesReference
    • iterator

      public org.apache.lucene.util.BytesRefIterator iterator()
      Description copied from interface: BytesReference
      Returns a BytesRefIterator for this BytesReference. This method allows access to the internal pages of this reference without copying them. Use with care!
      Specified by:
      iterator in interface BytesReference
      See Also:
      BytesRefIterator
    • equals

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

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

      public int compareTo(BytesReference other)
      Specified by:
      compareTo in interface Comparable<BytesReference>
    • toXContent

      public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.elasticsearch.common.xcontent.ToXContent
      Throws:
      IOException