Static methods
staticdecode(buffer:View<UInt8>):String
Decodes all the bytes in the buffer into a string. An empty string is returned if the buffer is empty.
staticencode(string:String, buffer:View<UInt8>):Int64
Encodes all characters in the string to ascii bytes.
If the string cannot be encoded to ASCII an exception is thrown. If the provided buffer is too small to fit the encoded data an exception is thrown and no data is written.
Parameters:
string | String to encode. |
|---|---|
buffer | Buffer bytes will be written into. |
Returns:
Number of bytes written into the buffer.