code: @Override
      public byte[] read() throws IllegalStateException, IOException{
          // validate state
          if (isClosed())
              throw new IllegalStateException("Serial connection is not open; cannot 'read()'.");
  
          // read serial data from receive buffer
          byte[] buffer = new byte[available()];
          receiveBuffer.getInputStream().read(buffer);
          return buffer;
      }
docs: <p>Reads all available bytes from the serial port/device.</p>
  
  @return Returns a byte array with the data read from the serial port.
  @throws IllegalStateException thrown if the serial port is not already open.
  @throws IOException thrown on any error.