Package com.yahoo.text
Class Utf8PartialArray
- java.lang.Object
-
- com.yahoo.text.AbstractUtf8Array
-
- com.yahoo.text.Utf8Array
-
- com.yahoo.text.Utf8PartialArray
-
- All Implemented Interfaces:
java.lang.Comparable<AbstractUtf8Array>
public class Utf8PartialArray extends Utf8Array
This wraps a window in a backing byte array. Without doing any copying.- Since:
- 5.2
- Author:
- baldersheim
-
-
Constructor Summary
Constructors Constructor Description Utf8PartialArray(byte[] utf8data, int offset, int bytes)
Takes ownership of the given byte array.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getByteLength()
protected int
getByteOffset()
-
Methods inherited from class com.yahoo.text.AbstractUtf8Array
ascii7BitLowerCase, compareTo, equals, getByte, hashCode, isEmpty, toString, wrap, writeTo
-
-
-
-
Constructor Detail
-
Utf8PartialArray
public Utf8PartialArray(byte[] utf8data, int offset, int bytes)
Takes ownership of the given byte array. And keeps note of where the interesting utf8 sequence start and its length.- Parameters:
utf8data
- The backing byte array.offset
- The start of the utf8 sequence.bytes
- The length of the utf8 sequence.
-
-
Method Detail
-
getByteLength
public int getByteLength()
- Overrides:
getByteLength
in classUtf8Array
- Returns:
- Length in bytes of the utf8 sequence.
-
getByteOffset
protected int getByteOffset()
- Overrides:
getByteOffset
in classUtf8Array
- Returns:
- The offset in the backing array where the utf8 sequence starts.
-
-