docs: public static InputStream byteBufferToInputStream(final ByteBuffer byteBuffer) {
          // https://stackoverflow.com/questions/4332264/wrapping-a-bytebuffer-with-an-inputstream/6603018#6603018
          return new InputStream() {
              /** The intermediate buffer. */
              final ByteBuffer buf = byteBuffer;
  
              @Override
              public int read() {
                  if (!buf.hasRemaining()) {
                      return -1;
                  }
                  return buf.get() & 0xFF;
              }
  
              @Override
              public int read(final byte[] bytes, final int off, final int len) {
                  if (!buf.hasRemaining()) {
                      return -1;
                  }
  
                  final int bytesRead = Math.min(len, buf.remaining());
                  buf.get(bytes, off, bytesRead);
                  return bytesRead;
              }
          };
      }