Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Jul 2010

    DataInputStream Error "Unexpected end of the Stream"

    while running the following program

    while ((read=dataIn.read(buffer))>=0)
    byteout.write(buffer, 0, read);


    read is the Integer Object
    dataIn is the DataInputStream Object
    byteout is the ByteArrayOutputStream Object

    i got the following Error
    java.io.IOException: unexpected end of stream
    at com.sun.midp.io.j2me.http.Protocol.readBytesChunked(Protocol.java:888)
    at com.sun.midp.io.j2me.http.Protocol.readBytes(Protocol.java:558)
    at com.sun.midp.io.BaseInputStream.read(), bci=227
    at com.sun.midp.io.BufferedInputStream.fill(), bci=172
    at com.sun.midp.io.BufferedInputStream.read1(), bci=44
    at com.sun.midp.io.BufferedInputStream.read(), bci=39
    at java.io.DataInputStream.read(DataInputStream.java:83)
    at filconn$1.actionPerformed(filconn.java:91)
    at com.sun.lwuit.Form$MenuBar.actionPerformed(Form.java:2674)
    at com.sun.lwuit.util.EventDispatcher.fireActionSync(), bci=19
    at com.sun.lwuit.util.EventDispatcher.fireActionEvent(EventDispatcher.java:211)
    at com.sun.lwuit.Button.fireActionEvent(Button.java:274)
    at com.sun.lwuit.Button.released(Button.java:295)
    at com.sun.lwuit.Form$MenuBar.keyReleased(Form.java:2960)
    at com.sun.lwuit.Form.keyReleased(Form.java:1731)
    at com.sun.lwuit.Display.handleEvent(Display.java:1232)
    at com.sun.lwuit.Display.edtLoopImpl(Display.java:636)
    at com.sun.lwuit.Display.mainEDTLoop(Display.java:591)
    at com.sun.lwuit.RunnableWrapper.run(RunnableWrapper.java:120)
    at java.lang.Thread.run(), bci=11

    Please Help me

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Cheshire, UK

    Re: DataInputStream Error "Unexpected end of the Stream"

    What if you used InputStream rather than DataInputStream?

    Or: DataInputStream.readFully()

    Is this Java ME SDK 3.0 emulator? I believe HTTP InputStreams have a bug in this emulator (see this thread).


Similar Threads

  1. Replies: 0
    Last Post: 2011-03-02, 05:41
  2. Is there a way to "edit" and "save" the "texts" of received SMS messages?
    By pamir_yasti in forum General Development Questions
    Replies: 1
    Last Post: 2010-07-16, 10:15
  3. Implementation of "End Key" in 5800
    By maymaria in forum Symbian User Interface
    Replies: 10
    Last Post: 2009-05-18, 11:49
  4. Unexpected "Certificate Error" on N96 -- typical fixes did not work
    By kludgey in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 1
    Last Post: 2009-02-12, 05:44
  5. Replies: 4
    Last Post: 2008-05-20, 19:07

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts