Translates between byte arrays and strings of "0"s and "1"s. More...
TODO: may want to add more bit vector functions like and/or/xor/nand. TODO: also might be good to generate boolean[] from byte[] et. cetera.
The following notice applies to the original API on which this API is based, and to its documentation. The documentation of this API has been revised from the original.
/* * Copyright (C) 2006 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */
Public Member Functions | |
byte[] | encode (byte[] raw) |
Converts an array of raw binary data into an array of ascii 0 and 1 characters. More... | |
Object | encode (Object raw) throws EncoderException |
Converts an array of raw binary data into an array of ascii 0 and 1 chars. More... | |
Object | decode (Object ascii) throws DecoderException |
Decodes a byte array where each byte represents an ascii '0' or '1'. More... | |
byte[] | decode (byte[] ascii) |
Decodes a byte array where each byte represents an ascii '0' or '1'. More... | |
byte[] | toByteArray (String ascii) |
Decodes a String where each char of the String represents an ascii '0' or '1'. More... | |
Static Public Member Functions | |
static byte[] | fromAscii (char[] ascii) |
Decodes a byte array where each char represents an ascii '0' or '1'. More... | |
static byte[] | fromAscii (byte[] ascii) |
Decodes a byte array where each byte represents an ascii '0' or '1'. More... | |
static byte[] | toAsciiBytes (byte[] raw) |
Converts an array of raw binary data into an array of ascii 0 and 1 character bytes - each byte is a truncated char. More... | |
static char[] | toAsciiChars (byte[] raw) |
Converts an array of raw binary data into an array of ascii 0 and 1 characters. More... | |
static String | toAsciiString (byte[] raw) |
Converts an array of raw binary data into a String of ascii 0 and 1 characters. More... | |
byte [] encode | ( | byte[] | raw | ) |
raw | the raw binary data to convert |
Implements BinaryEncoder.
Object encode | ( | Object | raw | ) | throws EncoderException |
raw | the raw binary data to convert |
EncoderException | if the argument is not a byte[] |
Implements Encoder.
Object decode | ( | Object | ascii | ) | throws DecoderException |
ascii | each byte represents an ascii '0' or '1' |
DecoderException | if argument is not a byte[], char[] or String |
Implements Decoder.
byte [] decode | ( | byte[] | ascii | ) |
ascii | each byte represents an ascii '0' or '1' |
Implements BinaryDecoder.
byte [] toByteArray | ( | String | ascii | ) |
ascii | String of '0' and '1' characters |
|
static |
ascii | each char represents an ascii '0' or '1' |
|
static |
ascii | each byte represents an ascii '0' or '1' |
|
static |
raw | the raw binary data to convert |
|
static |
raw | the raw binary data to convert |
|
static |
raw | the raw binary data to convert |