code: @Override
      public void write(byte[] data, int offset, int length) throws IllegalStateException, IOException{
          // validate state
          if (isClosed()) {
              throw new IllegalStateException("Serial connection is not open; cannot 'write()'.");
          }
  
          // write serial data to transmit buffer
          com.pi4j.jni.Serial.write(fileDescriptor, data, offset, length);
      }
docs: <p>Sends an array of bytes to the serial port/device identified by the given file descriptor.</p>
  
  @param data
  A ByteBuffer of data to be transmitted.
  @param offset
  The starting index (inclusive) in the array to send from.
  @param length
  The number of bytes from the byte array to transmit to the serial port.
  @throws IllegalStateException thrown if the serial port is not already open.
  @throws IOException thrown on any error.