@Test @DisplayName("An int can be read") void getInt() { assume(); for (val virtual : virtuals) { assertThat(virtual).isNotZero(); val base = virtual + PacketBufferWrapperConstants.PAYLOAD_OFFSET; val number = random.nextInt(); mmanager.putIntVolatile(base, number); val packet = new PacketBufferWrapper(virtual); assertThat(packet.getInt(0)).as("Payload int").isEqualTo(number); } }
public int getInt(final int offset) { val address = virtualAddress + PAYLOAD_OFFSET; if (DEBUG >= LOG_TRACE) { log.trace("Reading payload int @ 0x{} + {}.", leftPad(virtualAddress), offset); } return mmanager.getInt(address + offset); }
PacketBufferWrapper implements Comparable<PacketBufferWrapper> { public int getInt(final int offset) { val address = virtualAddress + PAYLOAD_OFFSET; if (DEBUG >= LOG_TRACE) { log.trace("Reading payload int @ 0x{} + {}.", leftPad(virtualAddress), offset); } return mmanager.getInt(address + offset); } }
PacketBufferWrapper implements Comparable<PacketBufferWrapper> { public int getInt(final int offset) { val address = virtualAddress + PAYLOAD_OFFSET; if (DEBUG >= LOG_TRACE) { log.trace("Reading payload int @ 0x{} + {}.", leftPad(virtualAddress), offset); } return mmanager.getInt(address + offset); }  }
PacketBufferWrapper implements Comparable<PacketBufferWrapper> { public int getInt(final int offset) { val address = virtualAddress + PAYLOAD_OFFSET; if (DEBUG >= LOG_TRACE) { log.trace("Reading payload int @ 0x{} + {}.", leftPad(virtualAddress), offset); } return mmanager.getInt(address + 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> { public int getInt(final int offset) { val address = virtualAddress + PAYLOAD_OFFSET; if (DEBUG >= LOG_TRACE) { log.trace("Reading payload int @ 0x{} + {}.", leftPad(virtualAddress), offset); } return mmanager.getInt(address + 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();  }