BufferedInputStream is broken

Date view Thread view Subject view Author view

From: Godmar Back (gback@cs.utah.edu)
Date: Sun Dec 13 1998 - 18:36:21 EST


I'm not sure how to best fix this.
I think it would be easier for whoever wrote BufferInputStream.java

Suppose somebody calls

        mark(6)
        read() (causes a read in fill of say 68 bytes)
        read()
        read()
        read()
        read()
        read()
        reset()
        mark(-1)
        read(b, 0, 13)

Then pos will be 2048, and read(,,) will fail.

This is what screws the GifDecoder up: it wants to read ahead 6 bytes,
pick a type, reset the stream and have a special decoder handle that type.

        - Godmar


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 19:57:14 EDT