55
edits
| Line 130: | Line 130: | ||
In addition to the methods and properties defined for the '''Stream''' class, ByteBuffers implement the following methods: | In addition to the methods and properties defined for the '''Stream''' class, ByteBuffers implement the following methods: | ||
;append(b Binary, [begin Number], [end Number]) | ;append(b Binary, [begin Number], [end Number]) ByteBuffer | ||
:Append b or, if begin and end are specified, a subrange of b to the end of the buffer, increasing its length by the number of appended bytes. This is equal to setting the stream's position to the value of its length property and then calling write(b). | :Append b or, if begin and end are specified, a subrange of b to the end of the buffer, increasing its length by the number of appended bytes. This is equal to setting the stream's position to the value of its length property and then calling write(b). This methods returns the buffer it was invoked on. | ||
;insert(pos Number, b Binary, [begin Number], [end Number]) | ;insert(pos Number, b Binary, [begin Number], [end Number]) | ||
:Insert b or, if begin and end are specified, a subrange of b at the given position, moving any bytes above that position and increasing the buffer's length by the number of inserted bytes. | :Insert b or, if begin and end are specified, a subrange of b at the given position, moving any bytes above that position and increasing the buffer's length by the number of inserted bytes. This methods returns the buffer it was invoked on. | ||
;remove(begin Number, end Number) | |||
:Remove a range of bytes from the buffer, moving any bytes above the range and decreasing the buffer's length by the number of removed bytes. This methods returns the buffer it was invoked on. | |||
;toByteString() ByteString | ;toByteString() ByteString | ||
edits