code: protected int readByte() throws IOException {
          if (commPort != null && commPort.isOpen()) {
              byte[] buffer = new byte[1];
              int cnt = commPort.readBytes(buffer, 1);
              if (cnt != 1) {
                  throw new IOException("Cannot read from serial port");
              }
              else {
                  return buffer[0] & 0xff;
              }
          }
          else {
              throw new IOException("Comm port is not valid or not open");
          }
      }
docs: Reads a byte from the comms port
  
  @return Value of the byte
  
  @throws IOException If it cannot read or times out