public static final byte[] decode(BufferedReader reader) throws IOException, Base64DecodingException {
  byte[] retBytes=null;
  UnsyncByteArrayOutputStream baos=null;
  try {
    baos=new UnsyncByteArrayOutputStream();
    String line;
    while (null != (line=reader.readLine())) {
      byte[] bytes=decode(line);
      baos.write(bytes);
    }
    retBytes=baos.toByteArray();
  }
  finally {
    baos.close();
  }
  return retBytes;
}

public static final byte [ ] decode ( BufferedReader reader ) throws IOException , Base64DecodingException { byte [ ] retBytes = null ; UnsyncByteArrayOutputStream baos = null ; try { baos = new UnsyncByteArrayOutputStream ( ) ; String line ; while ( null != ( line = reader . readLine ( ) ) ) { byte [ ] bytes = decode ( line ) ; baos . write ( bytes ) ; } retBytes = baos . toByteArray ( ) ; } finally { baos . close ( ) ; } return retBytes ; }
base64 decode the lines from the reader and return an inputstream with the bytes .
