@Test public void testB64from24bit() { final StringBuilder buffer = new StringBuilder(""); B64.b64from24bit((byte) 8, (byte) 16, (byte) 64, 2, buffer); B64.b64from24bit((byte) 7, (byte) 77, (byte) 120, 4, buffer); assertEquals("./spo/", buffer.toString()); }
static void b64from24bit(final byte b2, final byte b1, final byte b0, final int outLen, final StringBuilder buffer) { int w = ((b2 << 16) & 0x00ffffff) | ((b1 << 8) & 0x00ffff) | (b0 & 0xff); int n = outLen; while (n-- > 0) { buffer.append(B64T.charAt(w & 0x3f)); w >>= 6; } }
B64 { static void b64from24bit(final byte b2, final byte b1, final byte b0, final int outLen, final StringBuilder buffer) { int w = ((b2 << 16) & 0x00ffffff) | ((b1 << 8) & 0x00ffff) | (b0 & 0xff); int n = outLen; while (n-- > 0) { buffer.append(B64T.charAt(w & 0x3f)); w >>= 6; } } }
B64 { static void b64from24bit(final byte b2, final byte b1, final byte b0, final int outLen, final StringBuilder buffer) { int w = ((b2 << 16) & 0x00ffffff) | ((b1 << 8) & 0x00ffff) | (b0 & 0xff); int n = outLen; while (n-- > 0) { buffer.append(B64T.charAt(w & 0x3f)); w >>= 6; } }  }
B64 { static void b64from24bit(final byte b2, final byte b1, final byte b0, final int outLen, final StringBuilder buffer) { int w = ((b2 << 16) & 0x00ffffff) | ((b1 << 8) & 0x00ffff) | (b0 & 0xff); int n = outLen; while (n-- > 0) { buffer.append(B64T.charAt(w & 0x3f)); w >>= 6; } }   }
B64 { static void b64from24bit(final byte b2, final byte b1, final byte b0, final int outLen, final StringBuilder buffer) { int w = ((b2 << 16) & 0x00ffffff) | ((b1 << 8) & 0x00ffff) | (b0 & 0xff); int n = outLen; while (n-- > 0) { buffer.append(B64T.charAt(w & 0x3f)); w >>= 6; } }    }