pdk.util.Codec
functions to convert variables into special formats
Functions
encodeStringToBase64
Encodes a String into a newly-allocated Base64 encoded String.
Arguments:
cleanString :: pdk.core.String
Result:
output :: pdk.core.String - A newly-allocated base 64 string
Possible exceptions
NullPointerException - throws if the cleanString argument is
NULL
encodeFileToBase64
Encodes a File into a newly-allocated Base64 encoded String.
Arguments:
file :: pdk.io.File - the file to encode
Result:
output :: pdk.core.String - A newly-allocated base 64 string
Possible exceptions
NullPointerException - throws if the file argument is
NULL
decodeBase64ToFile
Decodes a Base64 string into a File.
Arguments:
fileName :: pdk.core.String
base64String :: pdk.core.String
Result:
output :: pdk.io.File - a file representation of a decoded base 64 string
Possible exceptions
NullPointerException - throws if the fileName or base64String argument is
NULL
hexStringToIntegerArray
Converts a hex string to an array of integers (each integer represents a byte).
Arguments:
hexString :: pdk.core.String
Result:
output :: pdk.core.Array<pdk.core.Integer>
Possible exceptions
NullPointerException - throws if the hexString argument is
NULL
integerArrayToHexString
Converts an array of integers (byte values) to a hex string.
Arguments:
array :: pdk.core.Array<pdk.core.Integer>
Result:
output :: pdk.core.String - hex string
Possible exceptions
NullPointerException - throws if the array argument is
NULL
asciiStringToHex
Converts an ASCII string to a hex string.
Arguments:
asciiString :: pdk.core.String
size :: pdk.core.Integer - size of output hex string: can be set to 0 - output hex string will have size that is required for hex representation (double ASCII string length), can be set greater than ASCII string length - output hex string will have trailing zeros up to specified size
Result:
output :: pdk.core.String - hex string
Possible exceptions
NullPointerException - throws if the asciiString or size argument is
NULL
hexStringToAscii
Converts a hex string to an ASCII string.
Arguments:
hexString :: pdk.core.String
Result:
output :: pdk.core.String - ascii string
Possible exceptions
NullPointerException - throws if the hexString argument is
NULL
hexStringToByteArray
Converts a hex string to a byte array.
Arguments:
hexString :: pdk.core.String
Result:
output :: pdk.core.Array<pdk.core.Byte>
Possible exceptions
NullPointerException - throws if the hexString argument is
NULL
byteArrayToHexString
Converts a byte array to a hex string.
Arguments:
byteArray :: pdk.core.Array<pdk.core.Byte>
Result:
output :: pdk.core.String - hex string
Possible exceptions
NullPointerException - throws if the byteArray argument is
NULL
Last updated