From 61612ebd02542528771dcac40188d6c62ac3affc Mon Sep 17 00:00:00 2001 From: hedgecrw85 Date: Wed, 8 Aug 2018 14:48:59 -0500 Subject: [PATCH] Update the javadocs for Input/OutputStream to reflect new Exception objects --- .../com/fazecast/jSerialComm/SerialPort.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/java/com/fazecast/jSerialComm/SerialPort.java b/src/main/java/com/fazecast/jSerialComm/SerialPort.java index 5c9c986..527d4fd 100644 --- a/src/main/java/com/fazecast/jSerialComm/SerialPort.java +++ b/src/main/java/com/fazecast/jSerialComm/SerialPort.java @@ -714,6 +714,14 @@ public final class SerialPort *

* Allows for easier read access of the underlying data stream and abstracts away many low-level read details. *

+ * Note that any time a method is marked as throwable for an {@link java.io.IOException} in the official Java + * {@link java.io.InputStream} documentation, you can catch this exception directly, or you can choose to catch + * either a {@link SerialPortIOException} or a {@link SerialPortTimeoutException} (or both) which may make it + * easier for your code to determine why the exception was thrown. In general, a {@link SerialPortIOException} + * means that the port is having connectivity issues, while a {@link SerialPortTimeoutException} indicates that + * a user timeout has been reached before valid data was able to be returned (as specified in the + * {@link #setComPortTimeouts(int, int, int)} method). + *

* Make sure to call the {@link java.io.InputStream#close()} method when you are done using this stream. * * @return An {@link java.io.InputStream} object associated with this serial port. @@ -726,6 +734,14 @@ public final class SerialPort *

* Allows for easier write access to the underlying data stream and abstracts away many low-level writing details. *

+ * Note that any time a method is marked as throwable for an {@link java.io.IOException} in the official Java + * {@link java.io.InputStream} documentation, you can catch this exception directly, or you can choose to catch + * either a {@link SerialPortIOException} or a {@link SerialPortTimeoutException} (or both) which may make it + * easier for your code to determine why the exception was thrown. In general, a {@link SerialPortIOException} + * means that the port is having connectivity issues, while a {@link SerialPortTimeoutException} indicates that + * a user timeout has been reached before valid data was able to be returned (as specified in the + * {@link #setComPortTimeouts(int, int, int)} method). + *

* Make sure to call the {@link java.io.OutputStream#close()} method when you are done using this stream. * * @return An {@link java.io.OutputStream} object associated with this serial port.