Patent ID: 7561079

Claim:
A method for encoding a bytestream in a data communication device, the method comprising: obtaining successive portions of the bytestream, each said successive portion being three bytes in length and comprising at least one byte of signed data in two's complement representation; for each said successive three-byte portion, using a first Base64 encoding operation to encode the successive three-byte portion, the first Base64 encoding operation comprising steps of: converting each said at least one byte of signed data to a respective data store; for each said at least one byte of signed data having a negative value, adding 256 to the respective data store; collecting each said data store into a respective portion of a common store in accordance with an order of the respective byte in the successive three-byte portion, the common store being four bytes in length; and encoding successive 6-bit portions of the common store using a Base64 alphabet to obtain a portion of encoded byte data, and appending the portion of encoded byte data to an output; obtaining any remaining portion of the bytestream, said remaining portion being one or two bytes in length and comprising at least one byte of signed data in two's complement representation; for the remaining one or two-byte portion, using a second Base64 encoding operation to encode the remaining one or two-byte portion, the second Base64 encoding operation comprising steps of: converting each said at least one byte of signed data to a respective data store; for each said at least one byte of signed data having a negative value, adding 256 to the respective data store; collecting each said data store into a respective portion of a common store in accordance with an order of the respective byte in the remaining one or two-byte portion; encoding successive 6-bit portions of the common store using a Base64 alphabet to obtain encoded byte data; and padding the encoded byte data to obtain a remaining portion of encoded byte data, and appending the remaining portion of encoded byte data to the output; and transmitting the output over a communications network to another data communications device.