Module jls.util.codec
Provide codec functions.
Available algorithms are base64, deflate, gzip, hex.
Functions
getCodec (alg) | Returns a codec. |
decode (alg, data) | Returns the decoded data. |
encode (alg, data) | Returns the encoded data. |
decodeStream (alg, sh) | Returns an decoding jls.io.streams.StreamHandler. |
encodeStream (alg, sh) | Returns an encoding jls.io.streams.StreamHandler. |
Functions
- getCodec (alg)
-
Returns a codec.
Parameters:
- alg string the name of the encoding or decoding algorithm
Returns:
-
the codec
- decode (alg, data)
-
Returns the decoded data.
Parameters:
Returns:
-
string
the decoded data
- encode (alg, data)
-
Returns the encoded data.
Parameters:
Returns:
-
string
the encoded data
- decodeStream (alg, sh)
-
Returns an decoding jls.io.streams.StreamHandler.
Parameters:
- alg string the name of the decoding algorithm
- sh StreamHandler the wrapped stream that will handle the decoded data
Returns:
-
StreamHandler
the stream handler that will decode data
- encodeStream (alg, sh)
-
Returns an encoding jls.io.streams.StreamHandler.
Parameters:
- alg string the name of the encoding algorithm
- sh StreamHandler the wrapped stream that will handle the encoded data
Returns:
-
StreamHandler
the stream handler that will encode data