open static fun buffer(): Buffer
Create a new, empty buffer.
Return
the buffer
open static fun buffer(initialSizeHint: Int): Buffer
Create a new buffer given the initial size hint.
If you know the buffer will require a certain size, providing the hint can prevent unnecessary re-allocations as the buffer is written to and resized.
initialSizeHint - the hint, in bytes
Return
the buffer
open static fun buffer(string: String): Buffer
Create a new buffer from a string. The string will be UTF-8 encoded into the buffer.
Return
the buffer
open static fun buffer(string: String, enc: String): Buffer
Create a new buffer from a string and using the specified encoding. The string will be encoded into the buffer using the specified encoding.
Return
the buffer