code: void readBytes(byte[] buffer, long bytesToRead) throws IOException {
          if (commPort != null && commPort.isOpen()) {
              int cnt = commPort.readBytes(buffer, bytesToRead);
              if (cnt != bytesToRead) {
                  throw new IOException("Cannot read from serial port - truncated");
              }
          }
          else {
              throw new IOException("Comm port is not valid or not open");
          }
      }
docs: Reads the specified number of bytes from the input stream
  
  @param buffer      Buffer to put data into
  @param bytesToRead Number of bytes to read
  @throws IOException If the port is invalid or if the number of bytes returned is not equal to that asked for