protected ByteArrayOutputStream parseBytes(ByteArrayOutputStream bos) throws IOException {
  int ch;
  for (ch=read(); ch >= 0 && ch != '<'; ch=read()) {
    int b1=ch;
    int b2=read();
    int b3=read();
    int b4=read();
    if (b4 != '=') {
      int chunk=((base64Decode[b1] << 18) + (base64Decode[b2] << 12) + (base64Decode[b3] << 6)+ (base64Decode[b4]));
      bos.write(chunk >> 16);
      bos.write(chunk >> 8);
      bos.write(chunk);
    }
 else     if (b3 != '=') {
      int chunk=((base64Decode[b1] << 12) + (base64Decode[b2] << 6) + (base64Decode[b3]));
      bos.write(chunk >> 8);
      bos.write(chunk);
    }
 else {
      int chunk=((base64Decode[b1] << 6) + (base64Decode[b2]));
      bos.write(chunk);
    }
  }
  if (ch == '<')   peek=ch;
  return bos;
}

protected ByteArrayOutputStream parseBytes ( ByteArrayOutputStream bos ) throws IOException { int ch ; for ( ch = read ( ) ; ch >= 0 && ch != '<' ; ch = read ( ) ) { int b1 = ch ; int b2 = read ( ) ; int b3 = read ( ) ; int b4 = read ( ) ; if ( b4 != '=' ) { int chunk = ( ( base64Decode [ b1 ] << 18 ) + ( base64Decode [ b2 ] << 12 ) + ( base64Decode [ b3 ] << 6 ) + ( base64Decode [ b4 ] ) ) ; bos . write ( chunk > > 16 ) ; bos . write ( chunk > > 8 ) ; bos . write ( chunk ) ; } else if ( b3 != '=' ) { int chunk = ( ( base64Decode [ b1 ] << 12 ) + ( base64Decode [ b2 ] << 6 ) + ( base64Decode [ b3 ] ) ) ; bos . write ( chunk > > 8 ) ; bos . write ( chunk ) ; } else { int chunk = ( ( base64Decode [ b1 ] << 6 ) + ( base64Decode [ b2 ] ) ) ; bos . write ( chunk ) ; } } if ( ch == '<' ) peek = ch ; return bos ; }
parses a byte array .
