Scoopta Scoopta - 1 year ago 139
Java Question

Reading /dev/input/js0 from Java

I'm trying to read

from Java but I keep getting Invalid argument
at Method)
at Test.main(

My code is


final class Test {
public static final void main(String[] args) {
try {
FileInputStream in = new FileInputStream("/dev/input/js0");
} catch(IOException e) {

My end goal is to be able to read input from my controller but I can't even seem to read one byte. What am I doing wrong? My user does have read and write access to the file.

Answer Source

Changing the FileInputStream to a BufferedInputStream seems to fix the issue.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download