Package 

Class Base64


  • 
    public class Base64
    
                        

    Provides methods for encoding and decoding data in Base64 format. The Base64 encoding and decoding process allows binary data to be represented in a textual form, suitable for transmission or storage in textual environments.

    • Method Summary

      Modifier and Type Method Description
      static int base64Decode(Array<byte> data, int offset, int datalen) Decodes a Base64 encoded byte array into its original byte array representation.The decoded data is written directly back into the input array starting at the specified offset.
      static int base64Encode(Array<byte> data, int offset, int len) Encodes a portion of the input byte array into Base64 format and writes the resultinto the input array starting at the specified offset.
      static int base64Encode(Array<byte> data, int inoffset, int outoffset, int inlen) Encodes a segment of the input byte array into Base64 format and writes the resultinto the specified section of the input array.
      static Array<byte> encode(Array<byte> in) Encodes the provided byte array into a Base64 encoded byte array.The encoding process converts the input data into a textual Base64 representation.
      static String encodeToString(Array<byte> in) Encodes the input byte array into a Base64 encoded string.
      static Array<byte> decodeToByteArray(String input) Decodes a Base64 encoded string into a byte array.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • base64Decode

         static int base64Decode(Array<byte> data, int offset, int datalen)

        Decodes a Base64 encoded byte array into its original byte array representation.The decoded data is written directly back into the input array starting at the specified offset.

        Parameters:
        data - the byte array containing the Base64 encoded data to decode and wherethe resulting decoded byte array will be written
        offset - the starting position within the input byte array for reading theBase64 encoded data and writing the decoded result
        datalen - the number of bytes from the input array to decode, starting at the offset
      • base64Encode

         static int base64Encode(Array<byte> data, int offset, int len)

        Encodes a portion of the input byte array into Base64 format and writes the resultinto the input array starting at the specified offset. The encoding process convertsthe given number of bytes to a Base64 representation and replaces the specified portionof the input array with the encoded output.

        Parameters:
        data - the byte array containing the data to encode and where the Base64 encodedresult is written
        offset - the starting position within the input byte array for writing the encoded data
        len - the number of bytes from the input byte array to encode
      • base64Encode

         static int base64Encode(Array<byte> data, int inoffset, int outoffset, int inlen)

        Encodes a segment of the input byte array into Base64 format and writes the resultinto the specified section of the input array.

        Parameters:
        data - the byte array containing the data to encode
        inoffset - the starting position in the input byte array for reading the data to encode
        outoffset - the starting position in the byte array where the encoded result will be written
        inlen - the number of bytes from the input byte array to encode
      • encode

         static Array<byte> encode(Array<byte> in)

        Encodes the provided byte array into a Base64 encoded byte array.The encoding process converts the input data into a textual Base64 representation.

        Parameters:
        in - the byte array containing data to be Base64 encoded
      • encodeToString

         static String encodeToString(Array<byte> in)

        Encodes the input byte array into a Base64 encoded string.

        Parameters:
        in - the byte array to be encoded
      • decodeToByteArray

         static Array<byte> decodeToByteArray(String input)

        Decodes a Base64 encoded string into a byte array.

        Parameters:
        input - the Base64 encoded string to decode