contents   index   previous   next



Buffer getString()

syntax:

buffer.getString([length])

where:

length - number of characters to get from the buffer.

 

return:

string - starting from the current cursor location and continuing for length bytes. If no length is specified, then the method reads until a NULL byte is encountered or the end of the buffer is reached.

 

The Buffer cursor property is updated to the position after the string returned.

 

description:

The string is read according to the value of the .unicode flag of the buffer. A terminating NULL byte is not added, even if a length parameter is not provided.

 

see:

Buffer putString()

 

example:

foo = new Buffer("abcd");

foo.cursor = 1;

goo = foo.getString(2);

//goo is now "bc"


Buffer compare()