#4 FlashBuffer InputStream reading fix

closed-fixed
None
5
2001-07-05
2001-06-29
Andrew Wason
No

The FlashBuffer constructor that takes an InputStream
does not fully read the InputStream into its internal
buffer.

This is because the buffer is initially allocated 10
bytes larger than what available() returns, and so for
a high latency InputStream the check for
(size==buf.length) is false and we never read the rest
of the stream.

Discussion

  • Andrew Wason
    Andrew Wason
    2001-06-29

    FlashBuffer buffer size fix

     
    Attachments
  • Andrew Wason
    Andrew Wason
    2001-06-30

    Logged In: YES
    user_id=247569

    Woops, it turns out this patch isn't enough - it's still
    broken. The problem is for high latency InputStreams the
    while loop can terminate too early. read() may only read a
    couple of bytes even though there are thousands left to go.
    As currently written, the while loop only runs if read()
    fills the buffer (count==left).

    I rewrote it to read and populate the buffer until EOF.
    I've attached a new patch, new-buffer.patch.

     
  • Andrew Wason
    Andrew Wason
    2001-06-30

    new FlashBuffer fix - use this one

     
    Attachments
  • Dmitry Skavish
    Dmitry Skavish
    2001-07-05

    • assigned_to: nobody --> skavish
    • status: open --> closed-fixed