Example #1
0
  public String read(BufferedInputStream bis) throws IOException {
    byte[] version = new byte[CSCP_VERSION_SIZE];
    byte[] bodylen = new byte[CSCP_BODYLEN_SIZE];
    byte[] body = new byte[0];

    bis.read(version, 0, CSCP_VERSION_SIZE);
    bis.read(bodylen, 0, CSCP_BODYLEN_SIZE);
    int ibodylen = Integer.valueOf((new String(bodylen)).trim());
    if (ibodylen > 0) {
      int restlen = ibodylen;
      do {
        CSCPPARAM param = new CSCPPARAM();
        param.read(bis);
        restlen -= param.size();
        add(param);
      } while (restlen > 0);
      body = new byte[ibodylen];
      // bis.read(body, 0, ibodylen);
    }
    return new String(body);
  }
Example #2
0
 public void add(CSCPPARAM param) {
   this.params.add(param);
   this.bodylen += param.size();
 }