@Test public void testDecode1Message() throws Exception { byte[] inputByte = IPFIXUtilTestHelper.collectMessage("ONT1", "$6$SW2yXjnVMkUwIUeQ$c.JydO461NKo/VTgTYbvtEyVnKQhUr4NRFaFQD3YI5UfC28WTSewVAaR6UjloBFa.N4lVYrr1at25omRhbPOI.", "admin"); IpfixMessageDecoder IpfixMessageDecoder = new IpfixMessageDecoder(); ChannelHandlerContext ctx = mock(ChannelHandlerContext.class); List<Object> checkedList = new ArrayList<>(); IpfixMessageDecoder.decode(ctx, Unpooled.wrappedBuffer(inputByte), checkedList); assertEquals(1, checkedList.size()); IpfixMessagesWrapper ipfixMessagesWrapper = (IpfixMessagesWrapper) checkedList.get(0); assertArrayEquals(inputByte, ipfixMessagesWrapper.getData()); }
@Override protected void decode(ChannelHandlerContext ctx, ByteBuf msg, List<Object> out) throws Exception { byte[] array = new byte[msg.readableBytes()]; msg.getBytes(msg.readerIndex(), array); handleCreateIpfixMessages(array, out, msg); }
IpfixMessageDecoder extends ByteToMessageDecoder { @Override protected void decode(ChannelHandlerContext ctx, ByteBuf msg, List<Object> out) throws Exception { byte[] array = new byte[msg.readableBytes()]; msg.getBytes(msg.readerIndex(), array); handleCreateIpfixMessages(array, out, msg); } }
IpfixMessageDecoder extends ByteToMessageDecoder { @Override protected void decode(ChannelHandlerContext ctx, ByteBuf msg, List<Object> out) throws Exception { byte[] array = new byte[msg.readableBytes()]; msg.getBytes(msg.readerIndex(), array); handleCreateIpfixMessages(array, out, msg); }  }
IpfixMessageDecoder extends ByteToMessageDecoder { @Override protected void decode(ChannelHandlerContext ctx, ByteBuf msg, List<Object> out) throws Exception { byte[] array = new byte[msg.readableBytes()]; msg.getBytes(msg.readerIndex(), array); handleCreateIpfixMessages(array, out, msg); }   }
IpfixMessageDecoder extends ByteToMessageDecoder { @Override protected void decode(ChannelHandlerContext ctx, ByteBuf msg, List<Object> out) throws Exception { byte[] array = new byte[msg.readableBytes()]; msg.getBytes(msg.readerIndex(), array); handleCreateIpfixMessages(array, out, msg); }    }