ReadString

Last Updated2014-11-15
Created At2014-11-15

Reads a string from a readable bitbuffer (bf_read).

native int ReadString(char[] buffer, int maxlength, bool line = false)

Parameters

char[] buffer
Destination string buffer.
int maxlength
Maximum length of output string buffer.
bool line
If true the buffer will be copied until it reaches a '\n' or a null terminator.

Return Value

int Number of bytes written to the buffer. If the bitbuffer stream overflowed, that is, had no terminator before the end of the stream, then a negative number will be returned equal to the number of characters written to the buffer minus 1. The buffer will be null terminated regardless of the return value.