ByteBuffer wrapper code
ByteBuffer wrapper code
(->str buf charset)Returns a string from this buffer's bytes using given charset. between the current buffer position and it's limit.
Returns a string from this buffer's bytes using given charset. between the current buffer position and it's limit.
(buf-size buf)The number of bytes used in this buffer
The number of bytes used in this buffer
(compact buf)Discards any data before the current position, then sets the position to the current limit.
Discards any data before the current position, then sets the position to the current limit.
(dup buf)Duplicates this buffer, without actually copying the data
Duplicates this buffer, without actually copying the data
(flip buf)Resets the position to zero and the limit to current position. Use this before reading back the bytes in the buffer.
Resets the position to zero and the limit to current position. Use this before reading back the bytes in the buffer.
(grow-buf buf len)Grows buffer so it can store at least len additional bytes
Grows buffer so it can store at least `len` additional bytes
(make-buf)(make-buf size)Creates a new ByteBuffer of given or default initial size.
Creates a new `ByteBuffer` of given or default initial size.
(put-buf buf data)(put-buf buf data off len)Writes data to the buffer. Expands buffer if necessary.
Writes data to the buffer. Expands buffer if necessary.
(put-buf-single buf b)Writes a single byte to the buffer
Writes a single byte to the buffer
(set-pos buf p)Sets this buffer's new position
Sets this buffer's new position
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |