Lines Matching refs:buffer
39 * Helper function for generating a buffer with test data.
47 ByteBuffer buffer = ByteBuffer.allocate(ProtocolPortTuple.RAW_BYTE_SIZE)
49 buffer.put((byte) protocol);
50 buffer.putShort((short) port);
51 buffer.put((byte) status);
52 buffer.position(0);
53 return buffer;
57 * Verify that BufferUnderflowException will be thrown when parsing an empty buffer.
67 * Verify that BufferUnderflowException will be thrown when parsing a buffer without
74 ByteBuffer buffer = ByteBuffer.allocate(ProtocolPortTuple.RAW_BYTE_SIZE - 1);
75 buffer.put(new byte[ProtocolPortTuple.RAW_BYTE_SIZE - 1]);
76 buffer.position(0);
77 ProtocolPortTuple.parse(buffer);
81 * Verify that the expected ProtocolPortTuple is returned when parsing a buffer contained
88 ByteBuffer buffer = getTestBuffer(TEST_PROTOCOL, TEST_PORT, TEST_STATUS);
90 assertEquals(expected, ProtocolPortTuple.parse(buffer));