buffer size of serial port

Discussion in 'Java' started by Wills, Sep 20, 2007.

  1. Wills

    Wills Guest

    Hi all,
    When using javax.comm for serial communications what is the
    buffer size where the data read from the UART is stored .The Serial
    Communication APIs tell that we can use an InputStream object over the
    Serial port to read data from it.The buffer size of the UART itself is
    two, but how to find the size of the Java Buffer where data from UART
    is kept before reading using read().

    Thanks in advance.
    Wills, Sep 20, 2007
    #1
    1. Advertising

  2. Wills wrote:
    > Hi all,
    > When using javax.comm for serial communications what is the
    > buffer size where the data read from the UART is stored .The Serial
    > Communication APIs tell that we can use an InputStream object over the
    > Serial port to read data from it.The buffer size of the UART itself is
    > two, but how to find the size of the Java Buffer where data from UART
    > is kept before reading using read().
    >
    > Thanks in advance.
    >


    Why do you care. Just read the data. If you need to buffer it some
    more, use a BufferedInputStream. If you really have to know you can
    call CommPort.getInputBufferSize(). Don't you have the docs?

    --

    Knute Johnson
    email s/nospam/knute/
    Knute Johnson, Sep 21, 2007
    #2
    1. Advertising

  3. Wills

    Wills Guest


    >
    > Why do you care. Just read the data. If you need to buffer it some
    > more, use a BufferedInputStream. If you really have to know you can
    > call CommPort.getInputBufferSize(). Don't you have the docs?
    >
    > --
    >
    > Knute Johnson
    > email s/nospam/knute/


    Thanks.
    The documentation says that the ".available()" method does not
    guarantee exact number of data(bytes) available in the Buffered output
    stream.
    Wills, Sep 26, 2007
    #3
  4. Wills wrote:
    >> Why do you care. Just read the data. If you need to buffer it some
    >> more, use a BufferedInputStream. If you really have to know you can
    >> call CommPort.getInputBufferSize(). Don't you have the docs?
    >>
    >> --
    >>
    >> Knute Johnson
    >> email s/nospam/knute/

    >
    > Thanks.
    > The documentation says that the ".available()" method does not
    > guarantee exact number of data(bytes) available in the Buffered output
    > stream.
    >


    It should come with a big warning not to use it too! You might want to
    post some of your code here so we can see what you are up to.

    --

    Knute Johnson
    email s/nospam/knute/
    Knute Johnson, Sep 26, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Skyhorse
    Replies:
    4
    Views:
    4,231
    EventHelix.com
    Apr 16, 2004
  2. Raja
    Replies:
    12
    Views:
    24,379
    John Harrison
    Jun 21, 2004
  3. Pom
    Replies:
    2
    Views:
    1,650
    Bas-i
    Jan 31, 2007
  4. alok
    Replies:
    2
    Views:
    320
    Ben Bacarisse
    Jun 18, 2007
  5. msalerno
    Replies:
    3
    Views:
    409
    Ilmari Karonen
    Jul 14, 2005
Loading...

Share This Page