Home | History | Annotate | Download | only in impl

Lines Matching refs:src

77 	 * @param src the source string.
80 public static final byte[] encode(byte[] src)
82 return encode(src, 0);
89 * @param src the source string.
94 public static final byte[] encode(byte[] src, int lineFeed)
104 int codeLength = ((src.length + 2) / 3) * 4;
119 while (sidx + 3 <= src.length)
121 bits24 = (src[sidx++] & 0xFF) << 16;
122 bits24 |= (src[sidx++] & 0xFF) << 8;
123 bits24 |= (src[sidx++] & 0xFF) << 0;
139 if (src.length - sidx == 2)
141 bits24 = (src[sidx ] & 0xFF) << 16;
142 bits24 |= (src[sidx + 1] & 0xFF) << 8;
151 else if (src.length - sidx == 1)
153 bits24 = (src[sidx] & 0xFF) << 16;
167 * @param src the source string.
170 public static final String encode(String src)
172 return new String(encode(src.getBytes()));
179 * @param src
185 public static final byte[] decode(byte[] src) throws IllegalArgumentException
192 for (sidx = 0; sidx < src.length; sidx++)
194 byte val = ascii[src[sidx]];
197 src[srcLen++] = val;
208 while (srcLen > 0 && src[srcLen - 1] == EQUAL)
220 dst[didx ] = (byte) (((src[sidx ] << 2) & 0xFF)
221 | ((src[sidx + 1] >>> 4) & 0x03));
222 dst[didx + 1] = (byte) (((src[sidx + 1] << 4) & 0xFF)
223 | ((src[sidx + 2] >>> 2) & 0x0F));
224 dst[didx + 2] = (byte) (((src[sidx + 2] << 6) & 0xFF)
225 | ((src[sidx + 3]) & 0x3F));
229 dst[didx] = (byte) (((src[sidx ] << 2) & 0xFF)
230 | ((src[sidx + 1] >>> 4) & 0x03));
234 dst[didx] = (byte) (((src[sidx + 1] << 4) & 0xFF)
235 | ((src[sidx + 2] >>> 2) & 0x0F));
244 * @param src the base64-encoded string.
247 public static final String decode(String src)
249 return new String(decode(src.getBytes()));