public int Read(byte[] buffer, int bytesToRead) { if (port == null) { return 0; } return port.Read(buffer, 0, bytesToRead); }