Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

input stream was truncated while reading a word #113

Open
jurivrljicak opened this issue Mar 15, 2024 · 10 comments
Open

input stream was truncated while reading a word #113

jurivrljicak opened this issue Mar 15, 2024 · 10 comments

Comments

@jurivrljicak
Copy link

Hello, from


SaneSession.java  

private void initSane() throws IOException {
    // RPC code
    outputStream.write(SaneRpcCode.SANE_NET_INIT);

    // version number
    outputStream.write(SaneWord.forSaneVersion(1, 0, 3));

    // username
    outputStream.write(System.getProperty("user.name"));
    outputStream.flush();

    **inputStream.readWord();**
    inputStream.readWord();
  }

I am getting 'input stream was truncated while reading a word' in the highlighted line.
I don't know why this happens, any idea?

Very often I have to plug/unplug the device for it to establish a communication but this time I can't pass through this error. Got stuck in there.

Using Ubuntu 16.04 LTS and the latest from jfreesane (1.0)

thanks

@sjamesr
Copy link
Owner

sjamesr commented Mar 15, 2024 via email

@jurivrljicak
Copy link
Author

It's where I am trying to establish the connection.

			this.inetAddress = InetAddress.getByName(this.host);
			saneSession = SaneSession.withRemoteSane(inetAddress, port);

using Oracle OpenJDK 17.0.2

@jurivrljicak
Copy link
Author

could this be a hardware issue? I was tending to think that

@sjamesr
Copy link
Owner

sjamesr commented Mar 15, 2024 via email

@jurivrljicak
Copy link
Author

hmmm, the port is the default one

yes, scanimage -d kds_i900:i900 > output.pnm does work

@sjamesr
Copy link
Owner

sjamesr commented Mar 15, 2024 via email

@jurivrljicak
Copy link
Author

oh, sorry, then I get

$ scanimage -d net:localhost:kds_i900:i900
scanimage: open of device net:localhost:kds_i900:i900 failed: Error during device I/O

@sjamesr
Copy link
Owner

sjamesr commented Mar 15, 2024 via email

@jurivrljicak
Copy link
Author

jurivrljicak commented Mar 15, 2024 via email

@WilliamChengJia
Copy link

WilliamChengJia commented Nov 26, 2024

I've had this happen to me as well

my code:
InetAddress address = InetAddress.getLocalHost();
SaneSession saneSession = SaneSession.withRemoteSane(address);
List devices = saneSession.listDevices();

image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants