Lines Matching refs:input

76          * Encode/decode another block of input data.  this.output is
85 * @return true if the input so far is good; false if some
86 * error has been detected in the input stream..
88 public abstract boolean process(byte[] input, int offset, int len, boolean finish);
92 * could produce for the given number of input bytes. This may
103 * Decode the Base64-encoded data in input and return the data in
109 * @param str the input String to decode, which is converted to
114 * @throws IllegalArgumentException if the input contains
122 * Decode the Base64-encoded data in input and return the data in
128 * @param input the input array to decode
132 * @throws IllegalArgumentException if the input contains
135 public static byte[] decode(byte[] input, int flags) {
136 return decode(input, 0, input.length, flags);
140 * Decode the Base64-encoded data in input and return the data in
146 * @param input the data to decode
147 * @param offset the position within the input array at which to start
148 * @param len the number of bytes of input to decode
152 * @throws IllegalArgumentException if the input contains
155 public static byte[] decode(byte[] input, int offset, int len, int flags) {
156 // Allocate space for the most data the input could represent.
160 if (!decoder.process(input, offset, len, true)) {
228 * States 0-3 are reading through the next input tuple.
232 * in the input.
234 * in the input and no future input can "fix" it.
258 * Decode another block of input data.
261 * bad base-64 data has been detected in the input stream.
263 public boolean process(byte[] input, int offset, int len, boolean finish) {
282 // next four bytes of the input stream are all data
287 // If any of the next four bytes of input are non-data
297 (value = ((alphabet[input[p] & 0xff] << 18) |
298 (alphabet[input[p+1] & 0xff] << 12) |
299 (alphabet[input[p+2] & 0xff] << 6) |
300 (alphabet[input[p+3] & 0xff]))) >= 0) {
311 // partial tuple, or the next four input bytes aren't all
315 int d = alphabet[input[p++] & 0xff];
394 // We're out of input, but a future call could provide
402 // Done reading input. Now figure out where we are left in
410 // Read one extra input byte, which isn't enough to
415 // Read two extra input bytes, enough to emit 1 more
420 // Read three extra input bytes, enough to emit 2 more
449 * @param input the data to encode
454 public static String encodeToString(byte[] input, int flags) {
456 return new String(encode(input, flags), "US-ASCII");
467 * @param input the data to encode
468 * @param offset the position within the input array at which to
470 * @param len the number of bytes of input to encode
475 public static String encodeToString(byte[] input, int offset, int len, int flags) {
477 return new String(encode(input, offset, len, flags), "US-ASCII");
488 * @param input the data to encode
493 public static byte[] encode(byte[] input, int flags) {
494 return encode(input, 0, input.length, flags);
501 * @param input the data to encode
502 * @param offset the position within the input array at which to
504 * @param len the number of bytes of input to encode
509 public static byte[] encode(byte[] input, int offset, int len, int flags) {
535 encoder.process(input, offset, len, true);
603 public boolean process(byte[] input, int offset, int len, boolean finish) {
615 // with any input bytes available now and see if we can empty
626 // input available now.
628 ((input[p++] & 0xff) << 8) |
629 (input[p++] & 0xff);
636 // A 2-byte tail with at least 1 byte of input.
639 (input[p++] & 0xff);
658 // than 3 bytes of input available.
660 // The main loop, turning 3 input bytes into 4 output bytes on
663 v = ((input[p] & 0xff) << 16) |
664 ((input[p+1] & 0xff) << 8) |
665 (input[p+2] & 0xff);
680 // Finish up the tail of the input. Note that we need to
682 // remaining in input; there should be at most two bytes
687 v = ((tailLen > 0 ? tail[t++] : input[p++]) & 0xff) << 4;
701 v = (((tailLen > 1 ? tail[t++] : input[p++]) & 0xff) << 10) |
702 (((tailLen > 0 ? tail[t++] : input[p++]) & 0xff) << 2);
726 tail[tailLen++] = input[p];
728 tail[tailLen++] = input[p];
729 tail[tailLen++] = input[p+1];