Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > buffer size of serial port

Reply
Thread Tools

buffer size of serial port

 
 
Wills
Guest
Posts: n/a
 
      09-20-2007
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.

 
Reply With Quote
 
 
 
 
Knute Johnson
Guest
Posts: n/a
 
      09-21-2007
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/
 
Reply With Quote
 
 
 
 
Wills
Guest
Posts: n/a
 
      09-26-2007

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

 
Reply With Quote
 
Knute Johnson
Guest
Posts: n/a
 
      09-26-2007
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/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
why does select syscall returns evenif no data in serial port buffer alok C Programming 2 06-18-2007 11:45 AM
Can I connect router Serial interface directly to a PC serial port? Faustino Dina Cisco 2 08-18-2004 02:30 AM
How to know the buffer size and increase buffer size in c++ Raja C++ 12 06-21-2004 06:21 PM
Re: Serial port and PS/2 port schematics OR Assistive Tech. suggestion naive.verizon@locality.net Computer Support 1 07-10-2003 11:46 AM
Re: Serial port and PS/2 port schematics °Mike° Computer Support 1 07-09-2003 10:30 PM



Advertisments