xmlgraphics-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerem...@apache.org
Subject svn commit: r1070133 - in /xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec: png/ tiff/ util/
Date Sat, 12 Feb 2011 19:10:58 GMT
Author: jeremias
Date: Sat Feb 12 19:10:57 2011
New Revision: 1070133

URL: http://svn.apache.org/viewvc?rev=1070133&view=rev
Log:
Merged codec-related changes from Batik Trunk (r496552:1068104).

Modified:
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/png/PNGImageDecoder.java
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/png/PNGImageEncoder.java
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/png/PNGRed.java
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFDirectory.java
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFField.java
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFImage.java
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/util/ForwardSeekableStream.java
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/util/SeekableStream.java
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/util/SimpleRenderedImage.java

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/png/PNGImageDecoder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/png/PNGImageDecoder.java?rev=1070133&r1=1070132&r2=1070133&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/png/PNGImageDecoder.java
(original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/png/PNGImageDecoder.java
Sat Feb 12 19:10:57 2011
@@ -62,6 +62,7 @@ public class PNGImageDecoder extends Ima
         super(input, param);
     }
 
+    @Override
     public RenderedImage decodeAsRenderedImage(int page) throws IOException {
         if (page != 0) {
             throw new IOException(PropertyUtil.getString("PNGImageDecoder19"));
@@ -76,19 +77,19 @@ class PNGChunk {
     byte[] data;
     int crc;
 
-    String typeString;
+    final String typeString;
 
-    public PNGChunk(int length, int type, byte[] data, int crc) {
+    PNGChunk(int length, int type, byte[] data, int crc) {
         this.length = length;
         this.type = type;
         this.data = data;
         this.crc = crc;
 
-        typeString = "";
-        typeString += (char)(type >> 24);
-        typeString += (char)((type >> 16) & 0xff);
-        typeString += (char)((type >> 8) & 0xff);
-        typeString += (char)(type & 0xff);
+        typeString = ""
+                     + (char)((type >>> 24) & 0xff)
+                     + (char)((type >>> 16) & 0xff)
+                     + (char)((type >>>  8) & 0xff)
+                     + (char)((type       ) & 0xff);
     }
 
     public int getLength() {
@@ -1220,21 +1221,21 @@ class PNGImage extends SimpleRenderedIma
     }
 
     private void parse_tEXt_chunk(PNGChunk chunk) {
-        String key = "";   // todo simplify this
-        String value = ""; // todo simplify this
-        byte b;
 
+        byte b;
+        StringBuffer key = new StringBuffer();
         int textIndex = 0;
         while ((b = chunk.getByte(textIndex++)) != 0) {
-            key += (char)b;
+            key.append( (char)b );
         }
 
+        StringBuilder value = new StringBuilder();
         for (int i = textIndex; i < chunk.getLength(); i++) {
-            value += (char)chunk.getByte(i);
+            value.append((char)chunk.getByte(i));
         }
 
-        textKeys.add(key);
-        textStrings.add(value);
+        textKeys.add(key.toString());
+        textStrings.add(value.toString());
     }
 
     private void parse_tIME_chunk(PNGChunk chunk) {
@@ -1339,16 +1340,16 @@ class PNGImage extends SimpleRenderedIma
     }
 
     private void parse_zTXt_chunk(PNGChunk chunk) {
-        String key = "";    // todo simplify this
-        String value = "";  // todo simplify this
-        byte b;
 
         int textIndex = 0;
+        StringBuffer key = new StringBuffer();
+        byte b;
         while ((b = chunk.getByte(textIndex++)) != 0) {
-            key += (char)b;
+            key.append( (char)b );
         }
         /* int method = */ chunk.getByte(textIndex++);
 
+        StringBuffer value = new StringBuffer();
         try {
             int length = chunk.getLength() - textIndex;
             byte[] data = chunk.getData();
@@ -1358,11 +1359,11 @@ class PNGImage extends SimpleRenderedIma
 
             int c;
             while ((c = iis.read()) != -1) {
-                value += (char)c;
+                value.append((char)c);
             }
 
-            ztextKeys.add(key);
-            ztextStrings.add(value);
+            ztextKeys.add(key.toString());
+            ztextStrings.add(value.toString());
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -1445,21 +1446,6 @@ class PNGImage extends SimpleRenderedIma
         }
     }
 
-    private static int paethPredictor(int a, int b, int c) {
-        int p = a + b - c;
-        int pa = Math.abs(p - a);
-        int pb = Math.abs(p - b);
-        int pc = Math.abs(p - c);
-
-        if ((pa <= pb) && (pa <= pc)) {
-            return a;
-        } else if (pb <= pc) {
-            return b;
-        } else {
-            return c;
-        }
-    }
-
     private static void decodePaethFilter(byte[] curr, byte[] prev,
                                           int count, int bpp) {
         int raw, priorPixel, priorRow, priorRowPixel;
@@ -1477,7 +1463,7 @@ class PNGImage extends SimpleRenderedIma
             priorRow = prev[i] & 0xff;
             priorRowPixel = prev[i - bpp] & 0xff;
 
-            curr[i] = (byte)(raw + paethPredictor(priorPixel,
+            curr[i] = (byte)(raw + PNGEncodeParam.paethPredictor(priorPixel,
                                                   priorRow,
                                                   priorRowPixel));
         }

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/png/PNGImageEncoder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/png/PNGImageEncoder.java?rev=1070133&r1=1070132&r2=1070133&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/png/PNGImageEncoder.java
(original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/png/PNGImageEncoder.java
Sat Feb 12 19:10:57 2011
@@ -19,8 +19,6 @@
 
 package org.apache.xmlgraphics.image.codec.png;
 
-import org.apache.xmlgraphics.image.codec.util.ImageEncoderImpl;
-
 import java.awt.Rectangle;
 import java.awt.image.ColorModel;
 import java.awt.image.IndexColorModel;
@@ -40,6 +38,8 @@ import java.util.TimeZone;
 import java.util.zip.Deflater;
 import java.util.zip.DeflaterOutputStream;
 
+import org.apache.xmlgraphics.image.codec.util.ImageEncoderImpl;
+
 class CRC {
 
     private static int[] crcTable = new int[256];
@@ -78,21 +78,24 @@ class ChunkStream extends OutputStream i
     private ByteArrayOutputStream baos;
     private DataOutputStream dos;
 
-    public ChunkStream(String type) throws IOException {
+    ChunkStream(String type) throws IOException {
         this.type = type;
 
         this.baos = new ByteArrayOutputStream();
         this.dos = new DataOutputStream(baos);
     }
 
+    @Override
     public void write(byte[] b) throws IOException {
         dos.write(b);
     }
 
+    @Override
     public void write(byte[] b, int off, int len) throws IOException {
         dos.write(b, off, len);
     }
 
+    @Override
     public void write(int b) throws IOException {
         dos.write(b);
     }
@@ -163,17 +166,31 @@ class ChunkStream extends OutputStream i
         crc = CRC.updateCRC(crc, data, 0, len);
         output.writeInt(crc ^ 0xffffffff);
     }
+
+    /** {@inheritDoc} */
+    @Override
+    public void close() throws IOException {
+
+        if ( baos != null ) {
+            baos.close();
+            baos = null;
+        }
+        if (dos != null) {
+            dos.close();
+            dos = null;
+        }
+    }
 }
 
 
 class IDATOutputStream extends FilterOutputStream {
 
-    private static final byte[] typeSignature =
-      {(byte)'I', (byte)'D', (byte)'A', (byte)'T'};
+    private static final byte[] typeSignature
+         = {(byte)'I', (byte)'D', (byte)'A', (byte)'T'};
 
     private int bytesWritten = 0;
     private int segmentLength;
-    byte[] buffer;
+    private byte[] buffer;
 
     public IDATOutputStream(OutputStream output,
                             int segmentLength) {
@@ -182,6 +199,7 @@ class IDATOutputStream extends FilterOut
         this.buffer = new byte[segmentLength];
     }
 
+    @Override
     public void close() throws IOException {
         flush();
     }
@@ -193,7 +211,12 @@ class IDATOutputStream extends FilterOut
         out.write(x & 0xff);
     }
 
+    @Override
     public void flush() throws IOException {
+        if (bytesWritten == 0) {
+            return;
+        }
+
         // Length
         writeInt(bytesWritten);
         // 'IDAT' signature
@@ -212,10 +235,12 @@ class IDATOutputStream extends FilterOut
         bytesWritten = 0;
     }
 
+    @Override
     public void write(byte[] b) throws IOException {
         this.write(b, 0, b.length);
     }
 
+    @Override
     public void write(byte[] b, int off, int len) throws IOException {
         while (len > 0) {
             int bytes = Math.min(segmentLength - bytesWritten, len);
@@ -230,6 +255,7 @@ class IDATOutputStream extends FilterOut
         }
     }
 
+    @Override
     public void write(int b) throws IOException {
         buffer[bytesWritten++] = (byte)b;
         if (bytesWritten == segmentLength) {
@@ -305,6 +331,7 @@ public class PNGImageEncoder extends Ima
         cs.writeByte(interlace ? (byte)1 : (byte)0);
 
         cs.writeToStream(dataOutput);
+        cs.close();
     }
 
     private byte[] prevRow = null;
@@ -483,12 +510,15 @@ public class PNGImageEncoder extends Ima
         }
 
         dos.finish();
+        dos.close();
         ios.flush();
+        ios.close();
     }
 
     private void writeIEND() throws IOException {
         ChunkStream cs = new ChunkStream("IEND");
         cs.writeToStream(dataOutput);
+        cs.close();
     }
 
     private static final float[] srgbChroma = {
@@ -510,6 +540,7 @@ public class PNGImageEncoder extends Ima
                 cs.writeInt((int)(chroma[i]*100000));
             }
             cs.writeToStream(dataOutput);
+            cs.close();
         }
     }
 
@@ -527,6 +558,7 @@ public class PNGImageEncoder extends Ima
             // everything is different.
             cs.writeInt((int)(gamma*100000/*+0.5*/));
             cs.writeToStream(dataOutput);
+            cs.close();
         }
     }
 
@@ -536,6 +568,7 @@ public class PNGImageEncoder extends Ima
             byte[] ICCProfileData = param.getICCProfileData();
             cs.write(ICCProfileData);
             cs.writeToStream(dataOutput);
+            cs.close();
         }
     }
 
@@ -548,6 +581,7 @@ public class PNGImageEncoder extends Ima
                 cs.writeByte(significantBits[i]);
             }
             cs.writeToStream(dataOutput);
+            cs.close();
         }
     }
 
@@ -558,6 +592,7 @@ public class PNGImageEncoder extends Ima
             int intent = param.getSRGBIntent();
             cs.write(intent);
             cs.writeToStream(dataOutput);
+            cs.close();
         }
     }
 
@@ -574,6 +609,7 @@ public class PNGImageEncoder extends Ima
         }
 
         cs.writeToStream(dataOutput);
+        cs.close();
     }
 
     private void writeBKGD() throws IOException {
@@ -603,6 +639,7 @@ public class PNGImageEncoder extends Ima
             }
 
             cs.writeToStream(dataOutput);
+            cs.close();
         }
     }
 
@@ -616,6 +653,7 @@ public class PNGImageEncoder extends Ima
             }
 
             cs.writeToStream(dataOutput);
+            cs.close();
         }
     }
 
@@ -642,6 +680,7 @@ public class PNGImageEncoder extends Ima
             }
 
             cs.writeToStream(dataOutput);
+            cs.close();
         } else if (colorType == PNG_COLOR_PALETTE) {
             int lastEntry = Math.min(255, alphaPalette.length - 1);
             int nonOpaque;
@@ -657,6 +696,7 @@ public class PNGImageEncoder extends Ima
                     cs.writeByte(alphaPalette[i]);
                 }
                 cs.writeToStream(dataOutput);
+                cs.close();
             }
         }
     }
@@ -671,6 +711,7 @@ public class PNGImageEncoder extends Ima
             cs.writeByte((byte)dims[2]);
 
             cs.writeToStream(dataOutput);
+            cs.close();
         }
     }
 
@@ -681,6 +722,7 @@ public class PNGImageEncoder extends Ima
             System.out.println("sPLT not supported yet.");
 
             cs.writeToStream(dataOutput);
+            cs.close();
         }
     }
 
@@ -709,6 +751,7 @@ public class PNGImageEncoder extends Ima
             cs.writeByte(second);
 
             cs.writeToStream(dataOutput);
+            cs.close();
         }
     }
 
@@ -727,6 +770,7 @@ public class PNGImageEncoder extends Ima
                 cs.write(value);
 
                 cs.writeToStream(dataOutput);
+                cs.close();
             }
         }
     }
@@ -748,8 +792,10 @@ public class PNGImageEncoder extends Ima
                 DeflaterOutputStream dos = new DeflaterOutputStream(cs);
                 dos.write(value);
                 dos.finish();
+                dos.close();
 
                 cs.writeToStream(dataOutput);
+                cs.close();
             }
         }
     }
@@ -763,6 +809,7 @@ public class PNGImageEncoder extends Ima
             ChunkStream cs = new ChunkStream(type);
             cs.write(data);
             cs.writeToStream(dataOutput);
+            cs.close();
         }
     }
 
@@ -814,6 +861,7 @@ public class PNGImageEncoder extends Ima
      * the end of the operation, this should be done if needed
      * by the caller of this method.
      */
+    @Override
     public void encode(RenderedImage im) throws IOException {
         this.image = im;
         this.width = image.getWidth();
@@ -998,5 +1046,6 @@ public class PNGImageEncoder extends Ima
         writeIEND();
 
         dataOutput.flush();
+        dataOutput.close();
     }
 }

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/png/PNGRed.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/png/PNGRed.java?rev=1070133&r1=1070132&r2=1070133&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/png/PNGRed.java
(original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/png/PNGRed.java
Sat Feb 12 19:10:57 2011
@@ -19,8 +19,6 @@
 
 package org.apache.xmlgraphics.image.codec.png;
 
-import org.apache.xmlgraphics.image.codec.util.PropertyUtil;
-
 import java.awt.Color;
 import java.awt.Point;
 import java.awt.Rectangle;
@@ -41,17 +39,19 @@ import java.io.DataInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.SequenceInputStream;
+import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Date;
 import java.util.GregorianCalendar;
-import java.util.Hashtable;
-import java.util.TimeZone;
-import java.util.Vector;
+import java.util.HashMap;
 import java.util.List;
-import java.util.ArrayList;
+import java.util.Map;
+import java.util.TimeZone;
 import java.util.zip.Inflater;
 import java.util.zip.InflaterInputStream;
 
 import org.apache.xmlgraphics.image.GraphicsUtil;
+import org.apache.xmlgraphics.image.codec.util.PropertyUtil;
 import org.apache.xmlgraphics.image.rendered.AbstractRed;
 import org.apache.xmlgraphics.image.rendered.CachableRed;
 
@@ -59,7 +59,6 @@ import org.apache.xmlgraphics.image.rend
  *
  * @version $Id$
  */
-
 public class PNGRed extends AbstractRed {
 
     static class PNGChunk {
@@ -279,7 +278,7 @@ public class PNGRed extends AbstractRed 
     private static final int POST_ADD_GRAY_TRANS_EXP =
         POST_ADD_GRAY_TRANS | POST_EXP_MASK;
 
-    private Vector streamVec = new Vector();
+    private List<InputStream> streamVec = new ArrayList<InputStream>();
     private DataInputStream dataStream;
 
     private int bytesPerPixel; // number of bytes per input pixel
@@ -297,8 +296,9 @@ public class PNGRed extends AbstractRed 
 
     private WritableRaster theTile;
     private Rectangle bounds;
+
     /** A Hashtable containing the image properties. */
-    private Hashtable properties = new Hashtable();
+    private Map<String, Object> properties = new HashMap<String, Object>();
 
 
     private int[] gammaLut = null;
@@ -479,6 +479,8 @@ public class PNGRed extends AbstractRed 
                 properties.put("significant_bits", significantBits);
             }
         }
+        distream.close();
+        stream.close();
     }
 
     private static String getChunkType(DataInputStream distream) {
@@ -748,7 +750,7 @@ public class PNGRed extends AbstractRed 
 
         // Parse prior IDAT chunks
         InputStream seqStream =
-            new SequenceInputStream(streamVec.elements());
+            new SequenceInputStream( Collections.enumeration( streamVec ));
         InputStream infStream =
             new InflaterInputStream(seqStream, new Inflater());
         dataStream = new DataInputStream(infStream);
@@ -783,6 +785,13 @@ public class PNGRed extends AbstractRed 
         }
 
         decodeImage(interlaceMethod == 1);
+
+        // Free resources associated with compressed data.
+        dataStream.close();
+        infStream.close();
+        seqStream.close();
+        streamVec = null;
+
         SampleModel sm = theTile.getSampleModel();
         ColorModel  cm;
 
@@ -1850,6 +1859,7 @@ public class PNGRed extends AbstractRed 
     }
 
     // RenderedImage stuff
+    @Override
     public Raster getTile(int tileX, int tileY) {
         if (tileX != 0 || tileY != 0) {
             // Error -- bad tile requested

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFDirectory.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFDirectory.java?rev=1070133&r1=1070132&r2=1070133&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFDirectory.java
(original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFDirectory.java
Sat Feb 12 19:10:57 2011
@@ -51,7 +51,7 @@ import org.apache.xmlgraphics.image.code
  * @see TIFFField
  * @version $Id$
  */
-public class TIFFDirectory extends Object implements Serializable {
+public class TIFFDirectory implements Serializable {
 
     /** A boolean storing the endianness of the stream. */
     boolean isBigEndian;

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFField.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFField.java?rev=1070133&r1=1070132&r2=1070133&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFField.java
(original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFField.java
Sat Feb 12 19:10:57 2011
@@ -37,7 +37,7 @@ import java.io.Serializable;
  *
  * @see TIFFDirectory
  */
-public class TIFFField extends Object implements Comparable, Serializable {
+public class TIFFField implements Comparable, Serializable {
 
     /** Flag for 8 bit unsigned integers. */
     public static final int TIFF_BYTE      =  1;

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFImage.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFImage.java?rev=1070133&r1=1070132&r2=1070133&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFImage.java
(original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFImage.java
Sat Feb 12 19:10:57 2011
@@ -142,7 +142,7 @@ public class TIFFImage extends AbstractR
     /**
      * Return as a long[] the value of a TIFF_LONG or TIFF_SHORT field.
      */
-    private final long[] getFieldAsLongs(TIFFField field) {
+    private long[] getFieldAsLongs(TIFFField field) {
         long[] value = null;
 
         if (field.getType() == TIFFField.TIFF_SHORT) {

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/util/ForwardSeekableStream.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/util/ForwardSeekableStream.java?rev=1070133&r1=1070132&r2=1070133&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/util/ForwardSeekableStream.java
(original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/util/ForwardSeekableStream.java
Sat Feb 12 19:10:57 2011
@@ -36,9 +36,6 @@ public class ForwardSeekableStream exten
     /** The current position. */
     long pointer = 0L;
 
-    /** The marked position. */
-    long markPos = -1L;
-
     /**
      * Constructs a <code>InputStreamForwardSeekableStream</code> from a
      * regular <code>InputStream</code>.
@@ -82,13 +79,19 @@ public class ForwardSeekableStream exten
         src.close();
     }
 
-    /** Forwards the request to the real <code>InputStream</code>. */
+    /**
+     * Forwards the request to the real <code>InputStream</code>.
+     * We use {@link SeekableStream#markPos}
+     */
     public final synchronized void mark(int readLimit) {
         markPos = pointer;
         src.mark(readLimit);
     }
 
-    /** Forwards the request to the real <code>InputStream</code>. */
+    /**
+     * Forwards the request to the real <code>InputStream</code>.
+     * We use {@link SeekableStream#markPos}
+     */
     public final synchronized void reset() throws IOException {
         if (markPos != -1) {
             pointer = markPos;

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/util/SeekableStream.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/util/SeekableStream.java?rev=1070133&r1=1070132&r2=1070133&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/util/SeekableStream.java
(original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/util/SeekableStream.java
Sat Feb 12 19:10:57 2011
@@ -188,7 +188,7 @@ public abstract class SeekableStream ext
     // public int available) throws IOException
     // public void close() throws IOException;
 
-    /** Marked position */
+    /** Marked position, shared by {@link ForwardSeekableStream} */
     protected long markPos = -1L;
 
     /**

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/util/SimpleRenderedImage.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/util/SimpleRenderedImage.java?rev=1070133&r1=1070132&r2=1070133&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/util/SimpleRenderedImage.java
(original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/util/SimpleRenderedImage.java
Sat Feb 12 19:10:57 2011
@@ -27,10 +27,11 @@ import java.awt.image.RenderedImage;
 import java.awt.image.SampleModel;
 import java.awt.image.WritableRaster;
 
-import java.util.Hashtable;
 import java.util.Vector;
 import java.util.List;
 import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
 
 /**
  * A simple class implemented the <code>RenderedImage</code>
@@ -80,7 +81,7 @@ public abstract class SimpleRenderedImag
     protected List sources = new ArrayList();
 
     /** A Hashtable containing the image properties. */
-    protected Hashtable properties = new Hashtable();
+    protected Map properties = new HashMap();
 
     public SimpleRenderedImage() {}
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org


Mime
View raw message