Lines Matching defs:ascii

78      * Converts an array of raw binary data into an array of ascii 0 and 1 characters.
82 * @return 0 and 1 ascii character bytes one for each bit of the argument
90 * Converts an array of raw binary data into an array of ascii 0 and 1 chars.
94 * @return 0 and 1 ascii character chars one for each bit of the argument
107 * Decodes a byte array where each byte represents an ascii '0' or '1'.
109 * @param ascii
110 * each byte represents an ascii '0' or '1'
116 public Object decode(Object ascii) throws DecoderException {
117 if (ascii == null) {
120 if (ascii instanceof byte[]) {
121 return fromAscii((byte[]) ascii);
123 if (ascii instanceof char[]) {
124 return fromAscii((char[]) ascii);
126 if (ascii instanceof String) {
127 return fromAscii(((String) ascii).toCharArray());
133 * Decodes a byte array where each byte represents an ascii '0' or '1'.
135 * @param ascii
136 * each byte represents an ascii '0' or '1'
140 public byte[] decode(byte[] ascii) {
141 return fromAscii(ascii);
145 * Decodes a String where each char of the String represents an ascii '0' or '1'.
147 * @param ascii
152 public byte[] toByteArray(String ascii) {
153 if (ascii == null) {
156 return fromAscii(ascii.toCharArray());
165 * Decodes a byte array where each char represents an ascii '0' or '1'.
167 * @param ascii
168 * each char represents an ascii '0' or '1'
171 public static byte[] fromAscii(char[] ascii) {
172 if (ascii == null || ascii.length == 0) {
176 byte[] l_raw = new byte[ascii.length >> 3];
181 for (int ii = 0, jj = ascii.length - 1; ii < l_raw.length; ii++, jj -= 8) {
183 if (ascii[jj - bits] == '1') {
192 * Decodes a byte array where each byte represents an ascii '0' or '1'.
194 * @param ascii
195 * each byte represents an ascii '0' or '1'
198 public static byte[] fromAscii(byte[] ascii) {
199 if (ascii == null || ascii.length == 0) {
203 byte[] l_raw = new byte[ascii.length >> 3];
208 for (int ii = 0, jj = ascii.length - 1; ii < l_raw.length; ii++, jj -= 8) {
210 if (ascii[jj - bits] == '1') {
219 * Converts an array of raw binary data into an array of ascii 0 and 1 character bytes - each byte is a truncated
250 * Converts an array of raw binary data into an array of ascii 0 and 1 characters.
280 * Converts an array of raw binary data into a String of ascii 0 and 1 characters.