@Test @DisplayName("The size can be written") void setSize() { assume(); val offset = PacketBufferWrapperConstants.HEADER_OFFSET + PacketBufferWrapperConstants.PKT_OFFSET; for (val virtual : virtuals) { assertThat(virtual).isNotZero(); val packet = new PacketBufferWrapper(virtual); val size = random.nextInt(); packet.setSize(size); assertThat(mmanager.getIntVolatile(virtual + offset)).as("Packet size").isEqualTo(size); } }
public void setSize(final int size) { if (DEBUG >= LOG_TRACE) { log.trace("Writing packet size field @ 0x{} + {}.", leftPad(virtualAddress), PKT_OFFSET); } mmanager.putIntVolatile(virtualAddress + PKT_OFFSET, size); }
PacketBufferWrapper implements Comparable<PacketBufferWrapper> { public void setSize(final int size) { if (DEBUG >= LOG_TRACE) { log.trace("Writing packet size field @ 0x{} + {}.", leftPad(virtualAddress), PKT_OFFSET); } mmanager.putIntVolatile(virtualAddress + PKT_OFFSET, size); } }
PacketBufferWrapper implements Comparable<PacketBufferWrapper> { public void setSize(final int size) { if (DEBUG >= LOG_TRACE) { log.trace("Writing packet size field @ 0x{} + {}.", leftPad(virtualAddress), PKT_OFFSET); } mmanager.putIntVolatile(virtualAddress + PKT_OFFSET, size); }  }
PacketBufferWrapper implements Comparable<PacketBufferWrapper> { public void setSize(final int size) { if (DEBUG >= LOG_TRACE) { log.trace("Writing packet size field @ 0x{} + {}.", leftPad(virtualAddress), PKT_OFFSET); } mmanager.putIntVolatile(virtualAddress + PKT_OFFSET, size); }  @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 void setSize(final int size) { if (DEBUG >= LOG_TRACE) { log.trace("Writing packet size field @ 0x{} + {}.", leftPad(virtualAddress), PKT_OFFSET); } mmanager.putIntVolatile(virtualAddress + PKT_OFFSET, size); }  @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();  }