-
Bug
-
Resolution: Fixed
-
P2
-
1.4.0
-
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.
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.
- relates to
-
JDK-4422328 MemoryCacheImageOutputStream can't flush or close
-
- Resolved
-