buffer size of serial port

W

Wills

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.
 
K

Knute Johnson

Wills said:
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?
 
W

Wills

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?

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

Knute Johnson

Wills said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top