Class RawData

    • Constructor Detail

      • RawData

        public RawData()
        Constructs an empty data object.
      • RawData

        public RawData​(byte[] data)
        Constructs a raw data object that holds the given byte array.
        Parameters:
        data - the rank to set
    • Method Detail

      • serialize

        public void serialize​(com.yahoo.vespa.objects.Serializer buf)
        Serializes the content of this data into the given byte buffer.
        Parameters:
        buf - the buffer to serialize to
      • deserialize

        public void deserialize​(com.yahoo.vespa.objects.Deserializer buf)
        Deserializes the content for this data from the given byte buffer.
        Parameters:
        buf - the buffer to deserialize from
      • getData

        public byte[] getData()
        Returns the byte array that constitutes this data.
        Returns:
        the byte array
      • setData

        public RawData setData​(byte[] data)
        Sets the byte array that constitutes this data. This does not copy the given array, it simply assigns it to this.
        Parameters:
        data - the data to set
        Returns:
        this, to allow chaining
      • hashCode

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

        public static int compare​(byte[] lhs,
                                  byte[] rhs)
        Implements comparison of two byte arrays.
        Parameters:
        lhs - the left-hand-side of the comparison
        rhs - the right-hand-side of the comparison
        Returns:
        the result of comparing the two byte arrays