public final class JPRAStringCursorByteBuffered extends Object implements JPRAStringCursorType
JPRAStringCursorType that accesses an
underlying ByteBuffer.| Modifier and Type | Method and Description |
|---|---|
byte |
getByte(int index) |
void |
getBytes(byte[] buf,
int buf_offset,
int length) |
Charset |
getEncoding() |
int |
getMaximumLength() |
String |
getNewValue() |
int |
getUsedLength() |
static JPRAStringCursorType |
newString(ByteBuffer in_buffer,
int in_offset,
JPRACursorByteReadableType in_cursor,
Charset in_encoding,
int in_max_length)
Construct a new string pointer.
|
void |
setValue(String text,
JPRAStringTruncation trunc)
Set the string value, optionally truncating data based on
trunc. |
public static JPRAStringCursorType newString(ByteBuffer in_buffer, int in_offset, JPRACursorByteReadableType in_cursor, Charset in_encoding, int in_max_length)
in_buffer - The byte bufferin_offset - The offset of this string from the base cursorin_cursor - The base cursorin_encoding - The string encodingin_max_length - The maximum string lengthpublic int getMaximumLength()
getMaximumLength in interface JPRAStringCursorReadableTypepublic int getUsedLength()
getUsedLength in interface JPRAStringCursorReadableTypepublic byte getByte(int index)
throws IndexOutOfBoundsException
getByte in interface JPRAStringCursorReadableTypeindex - The byte indexindex in the stringIndexOutOfBoundsException - Iff index >= getMaximumLength()public void getBytes(byte[] buf,
int buf_offset,
int length)
throws IndexOutOfBoundsException
getBytes in interface JPRAStringCursorReadableTypebuf - The buffer to which string data will be writtenbuf_offset - The starting index of buf to which data will be
writtenlength - The number of octets to copy into bufIndexOutOfBoundsException - Iff length > getMaximumLength()public String getNewValue()
getNewValue in interface JPRAStringCursorReadableTypepublic Charset getEncoding()
getEncoding in interface JPRAStringCursorReadableTypepublic void setValue(String text, JPRAStringTruncation trunc)
JPRAStringCursorWritableTypetrunc.setValue in interface JPRAStringCursorWritableTypetext - The new string valuetrunc - The truncation behaviourCopyright © 2017 <code@io7m.com> http://io7m.com