You do not need a library written especially for the Raspberry Pi. The major point of standardization and modularization of components, software and hardware, is interchangeability. A serial port is a serial port.
Of course, accessing a serial port "natively" on Windows is probably going to be different than on Linux (I presume you are using the latter), just as accessing a file at a low level natively on Windows is different than it is on Linux. However, when we use high level portable languages such as Java, these differences are abstracted away. There is not a java.io.microsoft
, a java.io.linux
, a java.io.osx
, a java.io.raspberrypi
, java.io.acme.laptop
, etc., etc. There is just java.io
.
The java core doesn't, as far as I know, include any serial port functionality, but I am sure (just from a quick internet search) that there is a small pile of third party serial com libs that you could check for your two requirements:
- Linux compatible.
- Supports xonxoff.
Actually there's a third, because almost certainly this library will have to make use of native code, i.e., be compiled from something that isn't pure Java, meaning it will have to be open source, unless you can find one precompiled for ARMv6 or 7 (depending on your model of pi).
Anyway, Arduino tools are written in Java, run on Linux, and require use of the serial port. They are also open source, and apparently the serial com library they use is RxTx -- no ARM binaries, but the source repo is available via the downloads page.
That's one example, and an explanation of what it is you are looking for, to make it easier for you to look yourself.