Пример #1
0
  public boolean processEnvelopeHeader(InputStream is) {
    boolean retval = false;
    if (null != is) {
      // Looks like the beginning of the envelope includes the size field ...
      this.is = is;

      crc.reset();

      /*
       **  Get the file size from the first four bytes.
       */
      byte[] fileSizeAndTagBytes = new byte[5];

      try {
        is.read(fileSizeAndTagBytes, 0, 5);
        ByteDecoder bd = new ByteDecoder(fileSizeAndTagBytes);

        size = bd.readInt(4);
        tag = bd.readInt(1);
        // ^^FQt=envel sz/tag:
        // System.out.println("^^FQt" + size + "/" + tag);	//remove me
        retval = true;
      } catch (IOException ioe) {
        size = -1;
        tag = -1;
      }
    }
    return retval;
  }
Пример #2
0
 public Envelope(InputStream is) {
   this.is = is;
   crc.reset();
 }