public byte[] toByteArray(){
  final int outLen=3 * (Short.SIZE / Byte.SIZE) + keyProviderIdLen_ + keyProviderInfoLen_ + encryptedKeyLen_;
  final ByteBuffer out=ByteBuffer.allocate(outLen);
  out.putShort(keyProviderIdLen_);
  out.put(keyProviderId_,0,keyProviderIdLen_);
  out.putShort(keyProviderInfoLen_);
  out.put(keyProviderInfo_,0,keyProviderInfoLen_);
  out.putShort(encryptedKeyLen_);
  out.put(encryptedKey_,0,encryptedKeyLen_);
  return out.array();
}

public byte [ ] toByteArray ( ) { final int outLen = 3 * ( Short . SIZE / Byte . SIZE ) + keyProviderIdLen_ + keyProviderInfoLen_ + encryptedKeyLen_ ; final ByteBuffer out = ByteBuffer . allocate ( outLen ) ; out . putShort ( keyProviderIdLen_ ) ; out . put ( keyProviderId_ , 0 , keyProviderIdLen_ ) ; out . putShort ( keyProviderInfoLen_ ) ; out . put ( keyProviderInfo_ , 0 , keyProviderInfoLen_ ) ; out . putShort ( encryptedKeyLen_ ) ; out . put ( encryptedKey_ , 0 , encryptedKeyLen_ ) ; return out . array ( ) ; }
serialize an instance of this class to a byte array .
