Logo Search packages:      
Sourcecode: libgnucrypto-java version File versions  Download package

byte [] gnu::crypto::key::OutgoingMessage::toByteArray (  )  throws KeyAgreementException [inline]

Returns the encoded form of the current message including the 4-byte length header.

Exceptions:
KeyAgreementException if an encoding size constraint is violated.

Definition at line 89 of file OutgoingMessage.java.

References wrap().

                                                            {
      byte[] buffer = wrap();
      int length = buffer.length;
      byte[] result = new byte[length+4];
      result[0] = (byte)(length >>> 24);
      result[1] = (byte)(length >>> 16);
      result[2] = (byte)(length >>>  8);
      result[3] = (byte) length;
      System.arraycopy(buffer, 0, result, 4, length);

      return result;
   }


Generated by  Doxygen 1.6.0   Back to index