I've found [this](https://stackoverflow.com/questions/2183240/java-integer-to-byte-array) solution but it seems to be for Java SE. I can't find an alternative to the System.out.format() function. Also, I have changed the `ByteBuffer.allocate()` function to `ByteBuffer.allocateDirect()` is this correct?

```
    byte[] bytes = ByteBuffer.allocate(4).putInt(1695609641).array();

    for (byte b : bytes) {
         System.out.format("0x%x ", b);
    }

```

Thank you.