Vertica documentation is moving! Use our new documentation site at https://docs.rocketsoftware.com/bundle/vertica_24.1/page/index.html

com.vertica.sdk.VString Class Reference

Collaboration diagram for com.vertica.sdk.VString:

Public Member Functions
VString (ByteBuffer buf, int offset, int totalMaxLen)
VString (ByteBuffer hbuf, ByteBuffer dbuf, int hoffset, int doffset, int maxDataLen)
void copy (byte[] from)
void copy (String from)
void copy (VString from)
ByteBuffer data ()
boolean isNull ()
int length ()
void setNull ()
String str ()
String toString ()

Detailed Description

Representation of a String in Vertica. All character data is internally encoded as UTF-8 characters and is not NULL terminated.

Constructor & Destructor Documentation

◆VString() [1/2]

com.vertica.sdk.VString.VString(ByteBuffer buf, int offset, int totalMaxLen)

Contruct a VString object

Parameters

  • buf: the ByteBuffer providing the space to back the VString
  • offset: offset of the beginning of VString into the ByteBuffer
  • totalMaxLen: the maximum length of the string structure including the header

◆VString() [2/2]

com.vertica.sdk.VString.VString(ByteBuffer hbuf, ByteBuffer dbuf, int hoffset, int doffset, int maxDataLen)

Construct an out of line VString object

Parameters

  • hbuf: the ByteBuffer with the VString header
  • dbuf: the ByteBuffer with the actual data
  • hoffset: of the beginning of VString header in hbuf
  • doffset: offset of the actual string data
  • maxDataLen: maximum length of the string structure not including the header

Member Function Documentation

◆copy() [1/3]

void com.vertica.sdk.VString.copy(byte \[\] from)

Copy character data from byte array to the VString's internal buffer.

Parameters

  • from: array of bytes input data

◆copy() [2/3]

void com.vertica.sdk.VString.copy(String from)

Copy character data from String

Parameters

  • from: Java String object as character input data

◆copy() [3/3]

void com.vertica.sdk.VString.copy(VString from)

Copy data from another VString.

Parameters

  • from: The source VString

◆data()

ByteBuffer com.vertica.sdk.VString.data()

Provides a read-only ByteBuffer to this VString's internal character data.

Note The returned string is not null terminated

Returns the read only character data for this string in a ByteBuffer

◆isNull()

boolean com.vertica.sdk.VString.isNull()

Indicates if this VString contains the SQL NULL value

Returns true if this string contains the SQL NULL value, false otherwise

Referenced by com.vertica.sdk.VString.str().

◆length()

int com.vertica.sdk.VString.length()

Returns the length of this VString

Returns the length of the string, in bytes. Does not include any extra space for null characters.

Referenced by

◆setNull()

void com.vertica.sdk.VString.setNull()

Sets this VString to the SQL NULL value.

◆str()

String com.vertica.sdk.VString.str()

Provides a copy of this VString's data as a Java String

Returns a Java String copy of the data in this VString

Referenced by com.vertica.sdk.BlockReader.getString().