@Test @DisplayName("The size can be read") void getSize() { assume(); val offset = PacketBufferWrapperConstants.HEADER_OFFSET + PacketBufferWrapperConstants.PKT_OFFSET; for (val virtual : virtuals) { assertThat(virtual).isNotZero(); val size = random.nextInt(); mmanager.putIntVolatile(virtual + offset, size); val packet = new PacketBufferWrapper(virtual); assertThat(packet.getSize()).as("Packet size").isEqualTo(size); } }
@Contract(pure = true) public int getSize() { if (DEBUG >= LOG_TRACE) { log.trace("Reading packet size field @ 0x{} + {}.", leftPad(virtualAddress), PKT_OFFSET); } return mmanager.getIntVolatile(virtualAddress + PKT_OFFSET); }
PacketBufferWrapper implements Comparable<PacketBufferWrapper> { @Contract(pure = true) public int getSize() { if (DEBUG >= LOG_TRACE) { log.trace("Reading packet size field @ 0x{} + {}.", leftPad(virtualAddress), PKT_OFFSET); } return mmanager.getIntVolatile(virtualAddress + PKT_OFFSET); } }
PacketBufferWrapper implements Comparable<PacketBufferWrapper> { @Contract(pure = true) public int getSize() { if (DEBUG >= LOG_TRACE) { log.trace("Reading packet size field @ 0x{} + {}.", leftPad(virtualAddress), PKT_OFFSET); } return mmanager.getIntVolatile(virtualAddress + PKT_OFFSET); }  }
PacketBufferWrapper implements Comparable<PacketBufferWrapper> { @Contract(pure = true) public int getSize() { if (DEBUG >= LOG_TRACE) { log.trace("Reading packet size field @ 0x{} + {}.", leftPad(virtualAddress), PKT_OFFSET); } return mmanager.getIntVolatile(virtualAddress + PKT_OFFSET); }  @Contract(pure = true) long getPhysicalAddress(); @Contract(pure = true) int getSize(); void setSize(final int size); byte getByte(final int offset); void putByte(final int offset, final byte value); short getShort(final int offset); void putShort(final int offset, final short value); int getInt(final int offset); void putInt(final int offset, final int value); long getLong(final int offset); void putLong(final int offset, final long value); void get(final int offset, int bytes, final @NotNull byte[] buffer); void put(final int offset, int bytes, final @NotNull byte[] buffer); @Override @Contract(pure = true) int compareTo(final @NotNull PacketBufferWrapper o); @Override @Contract(pure = true) @NotNull String toString(); }
PacketBufferWrapper implements Comparable<PacketBufferWrapper> { @Contract(pure = true) public int getSize() { if (DEBUG >= LOG_TRACE) { log.trace("Reading packet size field @ 0x{} + {}.", leftPad(virtualAddress), PKT_OFFSET); } return mmanager.getIntVolatile(virtualAddress + PKT_OFFSET); }  @Contract(pure = true) long getPhysicalAddress(); @Contract(pure = true) int getSize(); void setSize(final int size); byte getByte(final int offset); void putByte(final int offset, final byte value); short getShort(final int offset); void putShort(final int offset, final short value); int getInt(final int offset); void putInt(final int offset, final int value); long getLong(final int offset); void putLong(final int offset, final long value); void get(final int offset, int bytes, final @NotNull byte[] buffer); void put(final int offset, int bytes, final @NotNull byte[] buffer); @Override @Contract(pure = true) int compareTo(final @NotNull PacketBufferWrapper o); @Override @Contract(pure = true) @NotNull String toString();  }