public final class UTF16Buffer extends Object
| Constructor and Description |
|---|
UTF16Buffer(char[] buffer,
int start,
int end)
Constructor for wrapping an existing UTF-16 code unit array.
|
| Modifier and Type | Method and Description |
|---|---|
void |
adjust(boolean lastWasCR)
Adjusts the start index to skip over the first character if it is a line
feed and the previous character was a carriage return.
|
char[] |
getBuffer()
Returns the backing buffer.
|
int |
getEnd()
Returns the end index.
|
int |
getStart()
Returns the start index.
|
boolean |
hasMore()
Checks if the buffer has data left.
|
void |
setEnd(int end)
Sets the end index.
|
void |
setStart(int start)
Sets the start index.
|
public UTF16Buffer(char[] buffer,
int start,
int end)
buffer - the backing bufferstart - the index of the first character to consumeend - the index immediately after the last character to consumepublic int getStart()
public void setStart(int start)
start - the start indexpublic char[] getBuffer()
public int getEnd()
public boolean hasMore()
true if there's data leftpublic void adjust(boolean lastWasCR)
lastWasCR - whether the previous character was a carriage returnpublic void setEnd(int end)
end - the end indexCopyright © 2024. All rights reserved.