code: protected byte[] readBytes(BufferedReader in, String endMarker) throws IOException
      {
          String line;
          StringBuilder buf = new StringBuilder();
  
          while ((line = in.readLine()) != null) {
              if (line.contains(endMarker)) {
                  break;
              }
              buf.append(line.trim());
          }
  
          return this.base64.decode(buf.toString());
      }
docs: Read base64 data up to an end marker and decode them.
  
  @param in the input reader to read from.
  @param endMarker the end marker.
  @return the data read.
  @throws IOException on error.