docs: public void ioctl(final long command, ByteBuffer data, IntBuffer offsets) throws IOException {
          ByteBuffer originalData = data;
  
          if(data == null || offsets == null)
              throw new NullPointerException("data and offsets required!");
  
          if(offsets.order() != ByteOrder.nativeOrder())
              throw new IllegalArgumentException("provided IntBuffer offsets ByteOrder must be native!");
  
          //buffers must be direct
          try {
              if(!data.isDirect()) {
                  ByteBuffer newBuf = getDataBuffer(data.limit());
                  int pos = data.position(); //keep position
  
                  data.rewind();
                  newBuf.clear();
                  newBuf.put(data);
                  newBuf.position(pos); //restore position
  
                  data = newBuf;
              }
  
              if(!offsets.isDirect()) {
                  IntBuffer newBuf = getOffsetsBuffer(offsets.remaining());
  
                  newBuf.clear();
                  newBuf.put(offsets);
                  newBuf.flip();
  
                  offsets = newBuf;
              }
          } catch (BufferOverflowException e) {
              throw new ScratchBufferOverrun();
          }
  
          if((offsets.remaining() & 1) != 0)
              throw new IllegalArgumentException("offset buffer must be even length!");
  
          for(int i = offsets.position() ; i < offsets.limit() ; i += 2) {
              final int ptrOffset = offsets.get(i);
              final int dataOffset = offsets.get(i + 1);
  
              if(dataOffset >= data.capacity() || dataOffset < 0)
                  throw new IndexOutOfBoundsException("invalid data offset specified in buffer: " + dataOffset);
  
              if((ptrOffset + wordSize) > data.capacity() || ptrOffset < 0)
                  throw new IndexOutOfBoundsException("invalid pointer offset specified in buffer: " + ptrOffset);
          }
  
          final int response = directIOCTLStructure(getFileDescriptor(), command, data,
                  data.position(), offsets, offsets.position(), offsets.remaining());
  
          if(response < 0)
              throw new LinuxFileException();
  
          //fast forward positions
          offsets.position(offsets.limit());
          data.rewind();
  
          //if original data wasnt direct, copy it back in.
          if(originalData != data) {
              originalData.rewind();
              originalData.put(data);
              originalData.rewind();
          }
      }