Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4417672

MemoryCacheImageOutputStream ignores stream position

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.4.0
    • 1.4.0
    • client-libs
    • None
    • beta
    • generic
    • solaris_7

        The MemoryCacheImageOutputStream class always appends written data to the
      end of the cache regardless of the stream position. This means that the PNG
      writer, for examples, produces bad output since it relies on the ability
      to seek backwards and 'backpatch' the length field of a chunk it has written.

        The fix is to add a stream position argument to the write methods in
      MemoryCache, and to handle the case where the write may wholly or partially
      occur in the existing portion of the cache.

        On a separate note, MemoryCache allows the length of the list of cached
      blocks to increase when a new block is added, but does not allow it to
      decrease when a block is removed. This is a (slow) memory leak and should
      be fixed.

        A regression test will be placed in
      javax/imageio/stream/MemoryCacheImageOutputStreamTest.java.

            dricesunw Daniel Rice (Inactive)
            dricesunw Daniel Rice (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: