private void parse_tEXt_chunk(PNGChunk chunk) {
        StringBuffer key = new StringBuffer();
        StringBuffer value = new StringBuffer();
        byte b;

        int textIndex = 0;
        while ((b = chunk.getByte(textIndex++)) != 0) {
            key.append( (char)b );
        }

        for (int i = textIndex; i < chunk.getLength(); i++) {
            value.append( (char)chunk.getByte(i) );
        }

        textKeys.add(key.toString());
        textStrings.add(value.toString());
    }
A convenience method to create an instance of
<code>ComponentColorModel</code> suitable for use with the
given <code>SampleModel</code>.  The <code>SampleModel</code>
should have a data type of <code>DataBuffer.TYPE_BYTE</code>,
<code>TYPE_USHORT</code>, or <code>TYPE_INT</code> and between
1 and 4 bands.  Depending on the number of bands of the
<code>SampleModel</code>, either a gray, gray+alpha, rgb, or
rgb+alpha <code>ColorModel</code> is returned.
plugins/svg-plugin/batik-codec-fix/src/main/java/org/apache/batik/ext/awt/image/codec/png/PNGRed.java