Bytes is an array of bytes.
Constructs object of type Bytes - sequence of bytes of numBytes length.
If encoding is not provided or is equal to "base64" then the method returns base64 representation of the byte vector. Otherwise if encoding is one of supported encondings from IANA charset list http://www.iana.org/assignments/character-sets the function returns decoded string.
var str = bytes.toString("UTF-8"); returns a string from UTF-8 encoded bytes.
Static method, constructs Bytes object (byte array) from string using specified encoding.
If encoding is not specified or is equal to "base64" then base64 encoding is used. Otherwise if encoding is one of supported encodings from IANA charset list http://www.iana.org/assignments/character-sets the function returns encoded bytes.
var bytes = Bytes.fromString("Привет, мир!", "utf-8"); returns utf-8 encoded bytes of the string.
returns 32 chars string that represents MD-5 digest of the byte array.
returns integer that is a result of CRC32 computation of given byte array.
Compares two Bytes object for content equality, returns -1,0 or 1. Where 0 if these two byte vectors are equal.
Saves content of the byte vector into the file. If file exists then it will be overwritten.
Static method. Creates new Bytes object, loads file into it and returns that object.
Creates new Bytes object - compression version of original bytes object.
Creates new Bytes object, restores previously compressed byte array. Returns null if the array was not previously compressed.