Record { @Deprecated public static List<Record> fromByteArray(byte[] byteArray, InetSocketAddress peerAddress, ConnectionIdGenerator cidGenerator, long receiveNanos) { if (byteArray == null) { throw new NullPointerException("Byte array must not be null"); } else if (peerAddress == null) { throw new NullPointerException("Peer address must not be null"); } DatagramReader reader = new DatagramReader(byteArray, false); return fromReader(reader, peerAddress, cidGenerator, receiveNanos); } Record(ContentType type, ProtocolVersion version, int epoch, long sequenceNumber, ConnectionId connectionId,
			byte[] fragmentBytes, InetSocketAddress peerAddress, long receiveNanos, boolean followUpRecord);  Record(ContentType type, int epoch, long sequenceNumber, DTLSMessage fragment, DTLSSession session,
			boolean cid, int pad);  Record(ContentType type, ProtocolVersion version, long sequenceNumber, DTLSMessage fragment, InetSocketAddress peerAddress); private  Record(ProtocolVersion version, int epoch, long sequenceNumber, long receiveNanos, InetSocketAddress peer, boolean followUpRecord); byte[] toByteArray(); int size(); @Deprecated static List<Record> fromByteArray(byte[] byteArray, InetSocketAddress peerAddress, ConnectionIdGenerator cidGenerator, long receiveNanos); static List<Record> fromReader(DatagramReader reader, InetSocketAddress peerAddress, ConnectionIdGenerator cidGenerator, long receiveNanos); boolean isFollowUpRecord(); boolean isNewClientHello(); boolean isDecoded(); ContentType getType(); ProtocolVersion getVersion(); int getEpoch(); long getSequenceNumber(); int getFragmentLength(); void applySession(DTLSSession session); InetSocketAddress getPeerAddress(); ConnectionId getConnectionId(); long getReceiveNanos(); byte[] getFragmentBytes(); DTLSMessage getFragment(); @Override String toString(); static final int CONTENT_TYPE_BITS; static final int VERSION_BITS; static final int EPOCH_BITS; static final int SEQUENCE_NUMBER_BITS; static final int LENGTH_BITS; static final int CID_LENGTH_BITS; static final int RECORD_HEADER_BITS; static final int RECORD_HEADER_BYTES; }
@Test public void testFromByteArrayRejectsIllformattedRecord() { byte[] illformattedRecord = new byte[]{TYPE_APPL_DATA}; List<Record> recordList = DtlsTestTools.fromByteArray(illformattedRecord, session.getPeer(), null, ClockUtil.nanoRealtime()); assertTrue("fromByteArray() should have detected malformed record", recordList.isEmpty()); }