String (final @NotNull ByteBuffer buffer) { final byte[] bytes = new byte[buffer.capacity()]; final ByteBuffer slice = buffer.duplicate(); slice.position(0) .limit(buffer.capacity()); slice.get(bytes); return Arrays.toString(bytes); }