ChunkedString

File & Network View source
ChunkedString
public class ChunkedString

Constructors

construct()
construct(int chunkSize)

Creates a chunked string with the given chunk size in bytes, which must be at least 1.

Methods

append(string pdata)
hasChunk() returns boolean
readChunk() returns string
resetRead()
getChunk(int index) returns string
getChunkCount() returns int

Returns the number of chunks in the string. The buffer counts as one chunk

getChunkSize() returns int

Returns the configured length of every chunk in the string, in bytes. The last chunk’s size may be smaller than this number, and with ENABLE_MULTIBYTE_SUPPORT any chunk may be up to 3 bytes larger.

length() returns int

Calculates the length of the whole string.

getUnsafeString() returns string

Concatenates all chunks into one string. This is unsafe because the chunked length might be above the maximum allowed string length.

getUnsafeSubString(int startIndex, int endIndex) returns string

Concatenates all chunks required to return the requested substring. This is unsafe because the chunked length might be above the maximum allowed string length.