contents   index   previous   next



Buffer subBuffer()

syntax:

buffer.subBuffer(begin, end)

where:

begin - start of offset

 

end - end of offset (up to but not including this point)

 

return:

object - another Buffer object consisting of the data between the positions specified by the parameters: begin and end.

 

description:

If the parameter begin is less than 0, then it is treated as 0, the start of the buffer. If the parameter end is beyond the end of the buffer, then the new sub-buffer is extended with NULL bytes. The original buffer is not altered.

 

see:

String subString()

 

example:

foo = new Buffer("abcd");

bar = foo.subBuffer(1,3);

// bar is now the string "bc"

// "a" was at position 0, "b" at position 1, etc.

// The parameter "3"

// or "nEnd" is the position to go up to,

// but NOT to be included in the string.

 


Buffer toString()