Ejemplo n.º 1
0
    /** Create a new message buffer and push it into the stack. */
    void newbuf() {
      // You can't create a new buff when toCopy != null
      // That is after calling pop() and before calling copy()
      // If you do, it is a bug
      if (toCopy != null) {
        throw new RuntimeException("BUG: Invalid newbuf() before copy()");
      }

      LengthRecordNode temp = new LengthRecordNode();

      temp.currentMessage = mMessage;
      temp.currentPosition = mPosition;

      temp.next = stack;
      stack = temp;

      stackSize = stackSize + 1;

      mMessage = new ByteArrayOutputStream();
      mPosition = 0;
    }