Class SerialPortClient

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class SerialPortClient
    extends Stream
    • Constructor Detail

      • SerialPortClient

        public SerialPortClient​(java.lang.String address,
                                int port,
                                java.lang.String[] params)
                         throws IOException
        Throws:
        IOException
    • Method Detail

      • readBytes

        public int readBytes​(byte[] buf,
                             int start,
                             int count)
                      throws IOException
        Description copied from class: Stream
        Reads bytes from the stream. Returns the number of bytes actually read or -1 if the end of the stream was reached. (if applicable to the stream)
        Specified by:
        readBytes in class Stream
        Parameters:
        buf - the byte array to read data into
        start - the start position in the array
        count - the number of bytes to read
        Throws:
        IOException
      • writeBytes

        public int writeBytes​(byte[] buf,
                              int start,
                              int count)
                       throws IOException
        Description copied from class: Stream
        Writes bytes to the stream. Returns the number of bytes actually written or throws an IOException if an error prevented the write operation from occurring.
        Specified by:
        writeBytes in class Stream
        Parameters:
        buf - the byte array to write data from
        start - the start position in the byte array
        count - the number of bytes to write
        Returns:
        the number of bytes actually written
        Throws:
        IOException
      • close

        public void close()
                   throws IOException
        Closes this I/O connection, releasing any associated resources. Once closed a connection is no longer valid.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        IOException - If an I/O error occurs.
      • finalize

        protected void finalize()
        Overrides:
        finalize in class java.lang.Object