Package com.yahoo.text
Class Utf8PartialArray
java.lang.Object
com.yahoo.text.AbstractUtf8Array
com.yahoo.text.Utf8Array
com.yahoo.text.Utf8PartialArray
- All Implemented Interfaces:
Comparable<AbstractUtf8Array>
This wraps a window in a backing byte array. Without doing any copying.
- Author:
- baldersheim
-
Field Summary
-
Constructor Summary
ConstructorDescriptionUtf8PartialArray
(byte[] utf8data, int offset, int bytes) Takes ownership of the given byte array. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the length in bytes of the utf8 sequence.protected int
Returns the offset in the backing array where the utf8 sequence starts.Methods inherited from class com.yahoo.text.AbstractUtf8Array
ascii7BitLowerCase, compareTo, equals, getByte, hashCode, isEmpty, toString, wrap, writeTo
-
Constructor Details
-
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 Details
-
getByteLength
public int getByteLength()Description copied from class:AbstractUtf8Array
Returns the length in bytes of the utf8 sequence.- Overrides:
getByteLength
in classUtf8Array
-
getByteOffset
protected int getByteOffset()Description copied from class:AbstractUtf8Array
Returns the offset in the backing array where the utf8 sequence starts.- Overrides:
getByteOffset
in classUtf8Array
-