Code example for ByteBuffer

Methods: get, getInt

0
	public int rekeyCtr; 
	public DeviceUID senderUID; 
	public byte ascNumber; 
 
	public UnrestrictedStatusECM(ByteBuffer b){ 
		deviceSectionCode =  b.get(); 
		encryptionErrorCode =  b.get(); 
		rekeyCtr = b.getInt(); 
		senderUID = DeviceUID.fromBuffer(b); 
		ascNumber = b.get(); 
	} 
 
	@Override 
	public byte[] getBytes() { 
		ByteBuffer b = ByteBuffer.allocate(SECTION_SIZE); 
		b.put(deviceSectionCode); 
		b.put(encryptionErrorCode); 
		b.putInt(rekeyCtr); 
		b.put(senderUID.getBytes()); 
		b.put(ascNumber); 
		return null;