Class RawBuffer
- java.lang.Object
-
- com.yahoo.search.grouping.request.RawBuffer
-
- All Implemented Interfaces:
java.lang.Cloneable
,java.lang.Comparable<RawBuffer>
public class RawBuffer extends java.lang.Object implements java.lang.Comparable<RawBuffer>, java.lang.Cloneable
This class represents a buffer of byte values to be used as a backing buffer for raw buckets.- Author:
- Ulf Lilleengen
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RawBuffer
clone()
int
compareTo(RawBuffer rhs)
boolean
equals(java.lang.Object other)
byte[]
getBytes()
Create a copy of data in the internal buffer.int
hashCode()
RawBuffer
put(byte value)
Insert a byte value into this buffer.RawBuffer
put(byte[] values)
Insert an array of byte values into this buffer.java.lang.String
toString()
-
-
-
Constructor Detail
-
RawBuffer
public RawBuffer()
Create an empty buffer.
-
RawBuffer
public RawBuffer(java.util.ArrayList<java.lang.Byte> buffer)
Create a buffer with initial content.- Parameters:
buffer
- A buffer of values to be assigned this buffer.
-
RawBuffer
public RawBuffer(byte[] bytes)
Create a buffer with initial content.- Parameters:
bytes
- A buffer of bytes to be assigned this buffer.
-
-
Method Detail
-
put
public RawBuffer put(byte value)
Insert a byte value into this buffer.- Parameters:
value
- The value to add to the buffer.- Returns:
- Reference to this.
-
put
public RawBuffer put(byte[] values)
Insert an array of byte values into this buffer.- Parameters:
values
- The array to add to the buffer.- Returns:
- Reference to this.
-
getBytes
public byte[] getBytes()
Create a copy of data in the internal buffer.- Returns:
- A copy of the data.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
clone
public RawBuffer clone()
- Overrides:
clone
in classjava.lang.Object
-
compareTo
public int compareTo(RawBuffer rhs)
- Specified by:
compareTo
in interfacejava.lang.Comparable<RawBuffer>
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
-