SaneSession

22 views
Skip to first unread message

Hsen Wehbe

unread,
Nov 15, 2021, 4:17:15 AM11/15/21
to jfreesane-discuss
Dear all, 
I want to know how should I create sane daemon to create SaneSession ?
since Im getting the following error:

Exception in thread "main" java.io.IOException: input stream was truncated while reading a word
at au.com.southsky.jfreesane.SaneWord.fromStream(SaneWord.java:43)
at au.com.southsky.jfreesane.SaneInputStream.readWord(SaneInputStream.java:139)
at au.com.southsky.jfreesane.SaneSession.initSane(SaneSession.java:390)
at au.com.southsky.jfreesane.SaneSession.withRemoteSane(SaneSession.java:194)
at au.com.southsky.jfreesane.SaneSession.withRemoteSane(SaneSession.java:142)
at au.com.southsky.jfreesane.SaneSession.withRemoteSane(SaneSession.java:116)
at com.tecfrac.fileprinter.file_printer.ScanV2.main(ScanV2.java:14)

and this is the code:

public static void main(String[] args) throws IOException, SaneException {
System.out.println("before");
SaneSession session = SaneSession.withRemoteSane(InetAddress.getByName("192.168.3.46"),9070);
System.out.println("after");
List<SaneDevice> devices = session.listDevices();
for(SaneDevice device : devices) {
System.out.println(device.getName());
}
}

thanks.
Reply all
Reply to author
Forward
0 new messages