Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java.io.IOException: too many bytes to write to stream

800417Jan 5 2010 — edited Jan 5 2010
Hello,

I am running a server and a client. The server processes the request and writes a response to the stream. If I run the server on Windows, everything works fine. But when I deploy the server on Linux (Ubuntu) server, I get the following exception. The following exception only occurs when the server tries to write a response with an accented character.

For example, *You will exhaust yourself if you feel obliged to live by other peopleâs rules or expectations. It is time to redefine your own existence.*

In the example, the underlined string is causing the problem.



java.io.IOException: too many bytes to write to stream
        at sun.net.httpserver.FixedLengthOutputStream.write(FixedLengthOutputStream.java:58)
        at java.io.FilterOutputStream.write(FilterOutputStream.java:80)
        at sun.net.httpserver.PlaceholderOutputStream.write(ExchangeImpl.java:370)
        at pk.com.digitania.httpapi.utils.HttpRecieverBase.handle(HttpRecieverBase.java:146)
        at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
        at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
        at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
        at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:555)
        at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
        at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:527)
        at sun.net.httpserver.ServerImpl$DefaultExecutor.execute(ServerImpl.java:119)
        at sun.net.httpserver.ServerImpl$Dispatcher.handle(ServerImpl.java:349)
        at sun.net.httpserver.ServerImpl$Dispatcher.run(ServerImpl.java:321)
        at java.lang.Thread.run(Thread.java:619)
Please help me

Regards,
Kashif
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 2 2010
Added on Jan 5 2010
2 comments
5,434 views