'java.io.IOException: Underlying input stream returned zero bytes' Occurs When Uploading a File with Size 2048 or Multiples of 2048

(Doc ID 2142623.1)

Last updated on MAY 26, 2016

Applies to:

Oracle JDeveloper - Version 11.1.2.4.0 to 12.2.1.0.0 [Release Oracle11g to 12c]
Information in this document applies to any platform.

Symptoms

 "java.io.IOException: Underlying input stream returned zero bytes" occurs when uploading a file which size is 2048 or multiples of 2048 bytes using org.apache.myfaces.trinidad.model.UploadedFile class.

  Caused by: java.io.IOException: Underlying input stream returned zero bytes
    at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:268)
    at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
    at java.io.InputStreamReader.read(InputStreamReader.java:167)
    at java.io.BufferedReader.fill(BufferedReader.java:136)
    at java.io.BufferedReader.readLine(BufferedReader.java:299)
    at java.io.BufferedReader.readLine(BufferedReader.java:362)
    at view.test.UploadedFileTemp.saveFileContents(UploadedFileTemp.java:100)
       ...

 

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms