commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dam...@apache.org
Subject svn commit: r1441747 - in /commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging: common/ formats/bmp/ formats/bmp/pixelparsers/ formats/gif/ formats/icns/ formats/ico/ formats/jpeg/ formats/jpeg/decoder/ formats/jpeg/exif/ formats/jpeg...
Date Sat, 02 Feb 2013 13:54:49 GMT
Author: damjan
Date: Sat Feb  2 13:54:48 2013
New Revision: 1441747

URL: http://svn.apache.org/viewvc?rev=1441747&view=rev
Log:
Cleanups.


Modified:
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/BinaryFileParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/BinaryFunctions.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/BinaryInputStream.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/BinaryOutputStream.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpImageParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/PixelParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/PixelParserRle.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/gif/GifImageParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/icns/IcnsImageParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/ico/IcoImageParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegUtils.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/segments/App2Segment.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/segments/ComSegment.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/segments/GenericSegment.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pcx/PcxImageParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/ScanExpediter.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/PsdImageParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/datareaders/CompressedDataReader.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffReader.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/wbmp/WbmpImageParser.java

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/BinaryFileParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/BinaryFileParser.java?rev=1441747&r1=1441746&r2=1441747&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/BinaryFileParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/BinaryFileParser.java Sat Feb  2 13:54:48 2013
@@ -29,11 +29,11 @@ public class BinaryFileParser {
     private ByteOrder byteOrder = ByteOrder.BIG_ENDIAN;
     protected boolean debug = false;
 
-    protected BinaryFileParser(final ByteOrder byteOrder) {
+    public BinaryFileParser(final ByteOrder byteOrder) {
         this.byteOrder = byteOrder;
     }
 
-    protected BinaryFileParser() {
+    public BinaryFileParser() {
     }
 
     protected void setByteOrder(final ByteOrder byteOrder) {
@@ -96,19 +96,14 @@ public class BinaryFileParser {
         return BinaryFunctions.readByte(name, is, exception);
     }
     
-    protected final byte[] readByteArray(final String name, final int length, final InputStream is,
+    protected final byte[] readBytes(final String name, final int length, final InputStream is,
             final String exception) throws IOException {
-        return BinaryFunctions.readByteArray(name, length, is, exception);
+        return BinaryFunctions.readBytes(name, length, is, exception);
     }
     
-    protected final byte[] readByteArray(final String name, final int length, final InputStream is)
+    protected final byte[] readBytes(final String name, final int length, final InputStream is)
             throws IOException {
-        return BinaryFunctions.readByteArray(name, length, is);
-    }
-    
-    protected byte[] readBytearray(final String name, final byte bytes[], final int start,
-            final int count) throws ImageReadException {
-        return BinaryFunctions.readBytearray(name, bytes, start, count);
+        return BinaryFunctions.readBytes(name, length, is);
     }
     
     protected final byte[] readBytes(final InputStream is, final int count) throws IOException {
@@ -136,9 +131,13 @@ public class BinaryFileParser {
         BinaryFunctions.skipBytes(is, length, exception);
     }
     
-    protected final byte[] getByteArrayTail(final String name, final byte bytes[], final int count)
+    protected final byte[] remainingBytes(final String name, final byte bytes[], final int count)
             throws ImageReadException {
-        return BinaryFunctions.getByteArrayTail(name, bytes, count);
+        return BinaryFunctions.remainingBytes(name, bytes, count);
+    }
+    
+    protected final byte[] slice(final byte bytes[], final int start, final int count) {
+        return BinaryFunctions.slice(bytes, start, count);
     }
     
     protected final int findNull(final byte src[]) {
@@ -208,9 +207,9 @@ public class BinaryFileParser {
         }
     }
 
-    protected final boolean compareByteArrays(final byte a[], final int aStart, final byte b[],
+    protected final boolean compareBytes(final byte a[], final int aStart, final byte b[],
             final int bStart, final int length) {
-        return BinaryFunctions.compareByteArrays(a, aStart, b, bStart, length);
+        return BinaryFunctions.compareBytes(a, aStart, b, bStart, length);
     }
     
     protected static boolean startsWith(final byte haystack[], final BinaryConstant needle) {

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/BinaryFunctions.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/BinaryFunctions.java?rev=1441747&r1=1441746&r2=1441747&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/BinaryFunctions.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/BinaryFunctions.java Sat Feb  2 13:54:48 2013
@@ -97,7 +97,7 @@ public class BinaryFunctions {
     public static final void readAndVerifyBytes(final String name, final InputStream is,
             final byte expected[], final String exception) throws ImageReadException,
             IOException {
-        final byte bytes[] = readByteArray(name, expected.length, is, exception);
+        final byte bytes[] = readBytes(name, expected.length, is, exception);
 
         for (int i = 0; i < expected.length; i++) {
             if (bytes[i] != expected[i]) {
@@ -142,13 +142,13 @@ public class BinaryFunctions {
         return (byte) (0xff & result);
     }
 
-    public static final byte[] readByteArray(final String name, final int length, final InputStream is)
+    public static final byte[] readBytes(final String name, final int length, final InputStream is)
             throws IOException {
         final String exception = name + " could not be read.";
-        return readByteArray(name, length, is, exception);
+        return readBytes(name, length, is, exception);
     }
 
-    public static final byte[] readByteArray(final String name, final int length, final InputStream is,
+    public static final byte[] readBytes(final String name, final int length, final InputStream is,
             final String exception) throws IOException {
         final byte result[] = new byte[length];
         int read = 0;
@@ -165,37 +165,14 @@ public class BinaryFunctions {
         return result;
     }
 
-    public static final byte[] readBytearray(final String name, final byte bytes[], final int start,
-            final int count) throws ImageReadException {
-        if (bytes.length < (start + count)) {
-            throw new ImageReadException("Invalid read. bytes.length: "
-                    + bytes.length + ", start: " + start + ", count: " + count);
-        }
-
-        final byte result[] = new byte[count];
-        System.arraycopy(bytes, start, result, 0, count);
-
-        return result;
-    }
-
-    public static final byte[] getByteArrayTail(final String name, final byte bytes[], final int count)
-            throws ImageReadException {
-        return readBytearray(name, bytes, count, bytes.length - count);
-    }
-
-    public static final byte[] getByteArrayHead(final String name, final byte bytes[], final int count)
+    public static final byte[] remainingBytes(final String name, final byte bytes[], final int count)
             throws ImageReadException {
-        return readBytearray(name, bytes, 0, bytes.length - count);
+        return slice(bytes, count, bytes.length - count);
     }
 
     public static final byte[] slice(final byte bytes[], final int start, final int count) {
-        if (bytes.length < (start + count)) {
-            return null;
-        }
-
         final byte result[] = new byte[count];
         System.arraycopy(bytes, start, result, 0, count);
-
         return result;
     }
 
@@ -213,40 +190,6 @@ public class BinaryFunctions {
         return slice(bytes, 0, count);
     }
 
-    public static final boolean compareByteArrays(final byte a[], final byte b[]) {
-        if (a.length != b.length) {
-            return false;
-        }
-
-        return compareByteArrays(a, 0, b, 0, a.length);
-    }
-
-    public static final boolean compareByteArrays(final byte a[], final int aStart, final byte b[],
-            final int bStart, final int length) {
-        if (a.length < (aStart + length)) {
-            return false;
-        }
-        if (b.length < (bStart + length)) {
-            return false;
-        }
-
-        for (int i = 0; i < length; i++) {
-            if (a[aStart + i] != b[bStart + i]) {
-                return false;
-            }
-        }
-
-        return true;
-    }
-
-    public static final boolean compareBytes(final byte a[], final byte b[]) {
-        if (a.length != b.length) {
-            return false;
-        }
-
-        return compareBytes(a, 0, b, 0, a.length);
-    }
-
     public static final boolean compareBytes(final byte a[], final int aStart, final byte b[],
             final int bStart, final int length) {
         if (a.length < (aStart + length)) {

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/BinaryInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/BinaryInputStream.java?rev=1441747&r1=1441746&r2=1441747&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/BinaryInputStream.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/BinaryInputStream.java Sat Feb  2 13:54:48 2013
@@ -51,11 +51,11 @@ public class BinaryInputStream extends I
         this.is = is;
     }
 
-    protected void setByteOrder(final ByteOrder byteOrder) {
+    public final void setByteOrder(final ByteOrder byteOrder) {
         this.byteOrder = byteOrder;
     }
 
-    protected ByteOrder getByteOrder() {
+    public final ByteOrder getByteOrder() {
         return byteOrder;
     }
 
@@ -93,7 +93,7 @@ public class BinaryInputStream extends I
         BinaryFunctions.readAndVerifyBytes(is, expected, exception);
     }
 
-    protected final void readAndVerifyBytes(final String name, final byte expected[],
+    public final void readAndVerifyBytes(final String name, final byte expected[],
             final String exception) throws ImageReadException, IOException {
         BinaryFunctions.readAndVerifyBytes(name, is, expected, exception);
     }
@@ -103,21 +103,16 @@ public class BinaryInputStream extends I
         BinaryFunctions.skipBytes(is, length, exception);
     }
 
-    protected final void scanForByte(final byte value) throws IOException {
+    public final void scanForByte(final byte value) throws IOException {
         BinaryFunctions.scanForByte(is, value);
     }
 
-    public final byte readByte(final String name, final String exception)
+    public final byte[] readBytes(final String name, final int length, final String exception)
             throws IOException {
-        return BinaryFunctions.readByte(name, is, exception);
-    }
-
-    public final byte[] readByteArray(final String name, final int length, final String exception)
-            throws IOException {
-        return BinaryFunctions.readByteArray(name, length, is, exception);
+        return BinaryFunctions.readBytes(name, length, is, exception);
     }
 
-    protected final void debugByteArray(final String name, final byte bytes[]) {
+    public final void debugByteArray(final String name, final byte bytes[]) {
         System.out.println(name + ": " + bytes.length);
 
         for (int i = 0; ((i < bytes.length) && (i < 50)); i++) {
@@ -125,7 +120,7 @@ public class BinaryInputStream extends I
         }
     }
 
-    protected final void debugNumberArray(final String name, final int numbers[], final int length) {
+    public final void debugNumberArray(final String name, final int numbers[], final int length) {
         System.out.println(name + ": " + numbers.length);
 
         for (int i = 0; ((i < numbers.length) && (i < 50)); i++) {
@@ -133,17 +128,12 @@ public class BinaryInputStream extends I
         }
     }
 
-    public final byte[] readBytearray(final String name, final byte bytes[], final int start,
-            final int count) throws ImageReadException {
-        return BinaryFunctions.readBytearray(name, bytes, start, count);
-    }
-
-    public final byte[] readByteArray(final int length, final String error)
+    public final byte[] readBytes(final int length, final String error)
             throws ImageReadException, IOException {
-        return BinaryFunctions.readByteArray("", length, is, error);
+        return BinaryFunctions.readBytes("", length, is, error);
     }
 
-    public final byte[] readByteArray(final int length, final String error,
+    public final byte[] readBytes(final int length, final String error,
             final boolean verbose, final boolean strict) throws ImageReadException,
             IOException {
         final byte bytes[] = new byte[length];
@@ -163,22 +153,12 @@ public class BinaryInputStream extends I
         return bytes;
     }
 
-    protected final byte[] getBytearrayTail(final String name, final byte bytes[], final int count)
-            throws ImageReadException {
-        return BinaryFunctions.getByteArrayTail(name, bytes, count);
-    }
-
-    protected final byte[] getBytearrayHead(final String name, final byte bytes[], final int count)
-            throws ImageReadException {
-        return BinaryFunctions.getByteArrayHead(name, bytes, count);
-    }
-
-    public final boolean compareByteArrays(final byte a[], final int aStart, final byte b[],
+    public final boolean compareBytes(final byte a[], final int aStart, final byte b[],
             final int bStart, final int length) {
-        return BinaryFunctions.compareByteArrays(a, aStart, b, bStart, length);
+        return BinaryFunctions.compareBytes(a, aStart, b, bStart, length);
     }
 
-    protected final int read4Bytes(final String name, final String exception, final ByteOrder byteOrder)
+    public final int read4Bytes(final String name, final String exception, final ByteOrder byteOrder)
             throws IOException {
         return BinaryFunctions.read4Bytes(name, is, exception, byteOrder);
     }
@@ -187,17 +167,16 @@ public class BinaryInputStream extends I
         return BinaryFunctions.read4Bytes("", is, exception, byteOrder);
     }
 
-    protected final int read3Bytes(final String name, final String exception, final ByteOrder byteOrder)
+    public final int read3Bytes(final String name, final String exception, final ByteOrder byteOrder)
             throws IOException {
         return BinaryFunctions.read3Bytes(name, is, exception, byteOrder);
     }
-
-    public final int read3Bytes(final String name, final String exception)
-            throws IOException {
+    
+    public final int read3Bytes(final String name, final String exception) throws IOException {
         return BinaryFunctions.read3Bytes(name, is, exception, byteOrder);
     }
 
-    protected final int read2Bytes(final String name, final String exception, final ByteOrder byteOrder)
+    public final int read2Bytes(final String name, final String exception, final ByteOrder byteOrder)
             throws IOException {
         return BinaryFunctions.read2Bytes(name, is, exception, byteOrder);
     }
@@ -211,20 +190,19 @@ public class BinaryInputStream extends I
         return BinaryFunctions.read2Bytes("", is, exception, byteOrder);
     }
 
-    public final int read1ByteInteger(final String exception)
-            throws ImageReadException, IOException {
-        return BinaryFunctions.readByte("", is, exception);
+    public final byte readByte(final String name, final String exception) throws IOException {
+        return BinaryFunctions.readByte(name, is, exception);
     }
 
-    protected final void printCharQuad(final String msg, final int i) {
+    public final void printCharQuad(final String msg, final int i) {
         BinaryFunctions.printCharQuad(msg, i);
     }
 
-    protected final void printByteBits(final String msg, final byte i) {
+    public final void printByteBits(final String msg, final byte i) {
         BinaryFunctions.printByteBits(msg, i);
     }
 
-    protected final static int charsToQuad(final char c1, final char c2, final char c3, final char c4) {
+    public final static int charsToQuad(final char c1, final char c2, final char c3, final char c4) {
         return BinaryFunctions.charsToQuad(c1, c2, c3, c4);
     }
 
@@ -236,12 +214,12 @@ public class BinaryInputStream extends I
         return BinaryFunctions.findNull(src, start);
     }
 
-    protected final byte[] getRAFBytes(final RandomAccessFile raf, final long pos,
+    public final byte[] getRAFBytes(final RandomAccessFile raf, final long pos,
             final int length, final String exception) throws IOException {
         return BinaryFunctions.getRAFBytes(raf, pos, length, exception);
     }
 
-    protected void skipBytes(final int length) throws IOException {
+    public void skipBytes(final int length) throws IOException {
         BinaryFunctions.skipBytes(is, length);
     }
 

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/BinaryOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/BinaryOutputStream.java?rev=1441747&r1=1441746&r2=1441747&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/BinaryOutputStream.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/BinaryOutputStream.java Sat Feb  2 13:54:48 2013
@@ -73,7 +73,6 @@ public class BinaryOutputStream extends 
             write(0xff & (value >> 16));
             write(0xff & (value >> 24));
         }
-        count += 4;
     }
 
     public final void write3Bytes(final int value) throws IOException {
@@ -86,7 +85,6 @@ public class BinaryOutputStream extends 
             write(0xff & (value >> 8));
             write(0xff & (value >> 16));
         }
-        count += 3;
     }
 
     public final void write2Bytes(final int value) throws IOException {
@@ -97,7 +95,6 @@ public class BinaryOutputStream extends 
             write(0xff & value);
             write(0xff & (value >> 8));
         }
-        count += 2;
     }
 
     public final void writeByteArray(final byte bytes[]) throws IOException {

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpImageParser.java?rev=1441747&r1=1441746&r2=1441747&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpImageParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpImageParser.java Sat Feb  2 13:54:48 2013
@@ -309,7 +309,7 @@ public class BmpImageParser extends Imag
                     // RLESamplesPerByte);
                     // System.out.println("xXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
                     // );
-                    final byte bytes[] = this.readByteArray("bytes", size, is,
+                    final byte bytes[] = this.readBytes("bytes", size, is,
                             "RLE: Absolute Mode");
                     baos.write(bytes);
                 }
@@ -406,7 +406,7 @@ public class BmpImageParser extends Imag
 
         byte colorTable[] = null;
         if (paletteLength > 0) {
-            colorTable = this.readByteArray("ColorTable", paletteLength, is,
+            colorTable = this.readBytes("ColorTable", paletteLength, is,
                     "Not a Valid BMP File");
         }
 
@@ -454,7 +454,7 @@ public class BmpImageParser extends Imag
                     + expectedDataOffset + ", paletteLength: " + paletteLength
                     + ", headerSize: " + headerSize + ")");
         } else if (extraBytes > 0) {
-            this.readByteArray("BitmapDataOffset", extraBytes, is,
+            this.readBytes("BitmapDataOffset", extraBytes, is,
                     "Not a Valid BMP File");
         }
 
@@ -468,7 +468,7 @@ public class BmpImageParser extends Imag
         if (rle) {
             imageData = getRLEBytes(is, rleSamplesPerByte);
         } else {
-            imageData = this.readByteArray("ImageData", imageDataSize, is,
+            imageData = this.readBytes("ImageData", imageDataSize, is,
                     "Not a Valid BMP File");
         }
 

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/PixelParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/PixelParser.java?rev=1441747&r1=1441746&r2=1441747&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/PixelParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/PixelParser.java Sat Feb  2 13:54:48 2013
@@ -37,7 +37,7 @@ public abstract class PixelParser {
         this.colorTable = ColorTable;
         this.imageData = ImageData;
 
-        is = new BinaryInputStream(new ByteArrayInputStream(ImageData), ByteOrder.INTEL);
+        is = new BinaryInputStream(new ByteArrayInputStream(ImageData), ByteOrder.LITTLE_ENDIAN);
     }
 
     public abstract void processImage(ImageBuilder imageBuilder)

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/PixelParserRle.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/PixelParserRle.java?rev=1441747&r1=1441746&r2=1441747&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/PixelParserRle.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/PixelParserRle.java Sat Feb  2 13:54:48 2013
@@ -133,7 +133,7 @@ public class PixelParserRle extends Pixe
                     // System.out.println("size: " + size);
                     // System.out.println("SamplesPerByte: " + SamplesPerByte);
 
-                    final byte bytes[] = is.readByteArray("bytes", size,
+                    final byte bytes[] = is.readBytes("bytes", size,
                             "RLE: Absolute Mode");
 
                     int remaining = b;

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/gif/GifImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/gif/GifImageParser.java?rev=1441747&r1=1441746&r2=1441747&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/gif/GifImageParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/gif/GifImageParser.java Sat Feb  2 13:54:48 2013
@@ -186,7 +186,7 @@ public class GifImageParser extends Imag
     private byte[] readSubBlock(final InputStream is) throws IOException {
         final int block_size = 0xff & readByte("block_size", is, "GIF: corrupt block");
 
-        final byte bytes[] = readByteArray("block", block_size, is,
+        final byte bytes[] = readBytes("block", block_size, is,
                 "GIF: corrupt block");
 
         return bytes;
@@ -422,7 +422,7 @@ public class GifImageParser extends Imag
             final FormatCompliance formatCompliance) throws IOException {
         final int actual_size = convertColorTableSize(ct_size);
 
-        final byte bytes[] = readByteArray("block", actual_size, is,
+        final byte bytes[] = readBytes("block", actual_size, is,
                 "GIF: corrupt Color Table");
 
         return bytes;
@@ -1082,7 +1082,7 @@ public class GifImageParser extends Imag
                     continue;
                 }
 
-                if (!compareByteArrays(blockBytes, 0,
+                if (!compareBytes(blockBytes, 0,
                         XMP_APPLICATION_ID_AND_AUTH_CODE, 0,
                         XMP_APPLICATION_ID_AND_AUTH_CODE.length)) {
                     continue;
@@ -1097,7 +1097,7 @@ public class GifImageParser extends Imag
                         + GIF_MAGIC_TRAILER.length) {
                     continue;
                 }
-                if (!compareByteArrays(blockBytes, blockBytes.length
+                if (!compareBytes(blockBytes, blockBytes.length
                         - GIF_MAGIC_TRAILER.length, GIF_MAGIC_TRAILER, 0,
                         GIF_MAGIC_TRAILER.length)) {
                     throw new ImageReadException(

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/icns/IcnsImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/icns/IcnsImageParser.java?rev=1441747&r1=1441746&r2=1441747&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/icns/IcnsImageParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/icns/IcnsImageParser.java Sat Feb  2 13:54:48 2013
@@ -218,7 +218,7 @@ public class IcnsImageParser extends Ima
                                                                                   // including
                                                                                   // this
                                                                                   // header
-        final byte[] data = readByteArray("Data", elementSize - 8, is,
+        final byte[] data = readBytes("Data", elementSize - 8, is,
                 "Not a Valid ICNS File");
 
         return new IcnsElement(type, elementSize, data);

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/ico/IcoImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/ico/IcoImageParser.java?rev=1441747&r1=1441746&r2=1441747&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/ico/IcoImageParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/ico/IcoImageParser.java Sat Feb  2 13:54:48 2013
@@ -406,7 +406,7 @@ public class IcoImageParser extends Imag
             GreenMask = read4Bytes("GreenMask", is, "Not a Valid ICO File");
             BlueMask = read4Bytes("BlueMask", is, "Not a Valid ICO File");
         }
-        final byte[] RestOfFile = readByteArray("RestOfFile", is.available(), is);
+        final byte[] RestOfFile = readBytes("RestOfFile", is.available(), is);
 
         if (Size != 40) {
             throw new ImageReadException(
@@ -483,7 +483,7 @@ public class IcoImageParser extends Imag
         final int tcolor_map_size_bytes = t_scanline_size * (Height / 2);
         byte[] transparency_map = null;
         try {
-            transparency_map = this.readByteArray("transparency_map",
+            transparency_map = this.readBytes("transparency_map",
                     tcolor_map_size_bytes, bmpInputStream,
                     "Not a Valid ICO File");
         } catch (final IOException ioEx) {

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageParser.java?rev=1441747&r1=1441746&r2=1441747&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageParser.java Sat Feb  2 13:54:48 2013
@@ -390,7 +390,7 @@ public class JpegImageParser extends Ima
         //
         // Debug.debug("head", head);
 
-        return getByteArrayTail("trimmed exif bytes", bytes, 6);
+        return remainingBytes("trimmed exif bytes", bytes, 6);
     }
 
     public boolean hasExifSegment(final ByteSource byteSource)

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegUtils.java?rev=1441747&r1=1441746&r2=1441747&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegUtils.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegUtils.java Sat Feb  2 13:54:48 2013
@@ -76,11 +76,11 @@ public class JpegUtils extends BinaryFil
                     break;
                 }
 
-                final byte segmentLengthBytes[] = readByteArray("segmentLengthBytes",
+                final byte segmentLengthBytes[] = readBytes("segmentLengthBytes",
                         2, is, "segmentLengthBytes");
                 final int segmentLength = toUInt16(segmentLengthBytes);
 
-                final byte segmentData[] = readByteArray("Segment Data",
+                final byte segmentData[] = readBytes("Segment Data",
                         segmentLength - 2, is,
                         "Invalid Segment: insufficient data");
 

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java?rev=1441747&r1=1441746&r2=1441747&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java Sat Feb  2 13:54:48 2013
@@ -67,7 +67,7 @@ public class JpegDecoder extends BinaryF
         try {
             final int segmentLength = read2Bytes("segmentLength", is,
                     "Not a Valid JPEG File");
-            final byte[] sosSegmentBytes = readByteArray("SosSegment",
+            final byte[] sosSegmentBytes = readBytes("SosSegment",
                     segmentLength - 2, is, "Not a Valid JPEG File");
             sosSegment = new SosSegment(marker, sosSegmentBytes);
 

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.java?rev=1441747&r1=1441746&r2=1441747&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.java Sat Feb  2 13:54:48 2013
@@ -379,7 +379,7 @@ public class ExifRewriter extends Binary
             exifPiece = (JFIFPieceSegment) jfifPieces.exifPieces.get(0);
 
             byte exifBytes[] = exifPiece.segmentData;
-            exifBytes = getByteArrayTail("trimmed exif bytes", exifBytes, 6);
+            exifBytes = remainingBytes("trimmed exif bytes", exifBytes, 6);
 
             writer = new TiffImageWriterLossless(outputSet.byteOrder, exifBytes);
 

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcParser.java?rev=1441747&r1=1441746&r2=1441747&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcParser.java Sat Feb  2 13:54:48 2013
@@ -29,6 +29,7 @@ import org.apache.commons.imaging.ImageR
 import org.apache.commons.imaging.ImageWriteException;
 import org.apache.commons.imaging.ImagingConstants;
 import org.apache.commons.imaging.common.BinaryFileParser;
+import org.apache.commons.imaging.common.BinaryFunctions;
 import org.apache.commons.imaging.common.BinaryInputStream;
 import org.apache.commons.imaging.common.BinaryOutputStream;
 import org.apache.commons.imaging.common.ByteOrder;
@@ -197,8 +198,7 @@ public class IptcParser extends BinaryFi
                 return elements;
             }
 
-            final byte recordData[] = readBytearray("recordData", bytes, index,
-                    recordSize);
+            final byte recordData[] = slice(bytes, index, recordSize);
             index += recordSize;
 
             // Debug.debug("recordSize", recordSize + " (0x"
@@ -273,7 +273,7 @@ public class IptcParser extends BinaryFi
             // Note that these are unsigned quantities. Name is always an even
             // number of bytes (including the 1st byte, which is the size.)
     
-            final byte[] idString = bis.readByteArray(
+            final byte[] idString = bis.readBytes(
                     PHOTOSHOP_IDENTIFICATION_STRING.size(),
                     "App13 Segment missing identification string");
             if (!PHOTOSHOP_IDENTIFICATION_STRING.equals(idString)) {
@@ -284,7 +284,7 @@ public class IptcParser extends BinaryFi
     
             while (true) {
                 final byte[] imageResourceBlockSignature = bis
-                        .readByteArray(CONST_8BIM.size(),
+                        .readBytes(CONST_8BIM.size(),
                                 "App13 Segment missing identification string",
                                 false, false);
                 if (null == imageResourceBlockSignature) {
@@ -303,25 +303,25 @@ public class IptcParser extends BinaryFi
                                     + ")");
                 }
     
-                final int blockNameLength = bis
-                        .read1ByteInteger("Image Resource Block missing name length");
+                final int blockNameLength = bis.readByte("Name length",
+                        "Image Resource Block missing name length");
                 if (verbose && blockNameLength > 0) {
                     Debug.debug("blockNameLength", blockNameLength + " (0x"
                             + Integer.toHexString(blockNameLength) + ")");
                 }
                 byte[] blockNameBytes;
                 if (blockNameLength == 0) {
-                    bis.read1ByteInteger("Image Resource Block has invalid name");
+                    bis.readByte("Block name bytes", "Image Resource Block has invalid name");
                     blockNameBytes = new byte[0];
                 } else {
-                    blockNameBytes = bis.readByteArray(blockNameLength,
+                    blockNameBytes = bis.readBytes(blockNameLength,
                             "Invalid Image Resource Block name", verbose, strict);
                     if (null == blockNameBytes) {
                         break;
                     }
     
                     if (blockNameLength % 2 == 0) {
-                        bis.read1ByteInteger("Image Resource Block missing padding byte");
+                        bis.readByte("Padding byte", "Image Resource Block missing padding byte");
                     }
                 }
     
@@ -342,7 +342,7 @@ public class IptcParser extends BinaryFi
                             + blockSize + " > " + bytes.length);
                 }
     
-                final byte[] blockData = bis.readByteArray(blockSize,
+                final byte[] blockData = bis.readBytes(blockSize,
                         "Invalid Image Resource Block data", verbose, strict);
                 if (null == blockData) {
                     break;
@@ -351,7 +351,7 @@ public class IptcParser extends BinaryFi
                 blocks.add(new IptcBlock(blockType, blockNameBytes, blockData));
     
                 if ((blockSize % 2) != 0) {
-                    bis.read1ByteInteger("Image Resource Block missing padding byte");
+                    bis.readByte("Padding byte", "Image Resource Block missing padding byte");
                 }
             }
     

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/segments/App2Segment.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/segments/App2Segment.java?rev=1441747&r1=1441746&r2=1441747&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/segments/App2Segment.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/segments/App2Segment.java Sat Feb  2 13:54:48 2013
@@ -50,7 +50,7 @@ public class App2Segment extends AppnSeg
             marker_length -= JpegImageParser.icc_profile_label.size();
             marker_length -= (1 + 1);
 
-            icc_bytes = readByteArray("App2 Data", marker_length, is,
+            icc_bytes = readBytes("App2 Data", marker_length, is,
                     "Invalid App2 Segment: insufficient data");
         } else {
             // debugByteArray("Unknown APP2 Segment Type", bytes);

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/segments/ComSegment.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/segments/ComSegment.java?rev=1441747&r1=1441746&r2=1441747&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/segments/ComSegment.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/segments/ComSegment.java Sat Feb  2 13:54:48 2013
@@ -36,7 +36,7 @@ public class ComSegment extends Segment 
             System.out.println("ComSegment marker_length: " + marker_length);
         }
 
-        comment = readByteArray("Comment", marker_length, is,
+        comment = readBytes("Comment", marker_length, is,
                 "Error reading JPEG comment");
 
         if (getDebug()) {

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/segments/GenericSegment.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/segments/GenericSegment.java?rev=1441747&r1=1441746&r2=1441747&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/segments/GenericSegment.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/segments/GenericSegment.java Sat Feb  2 13:54:48 2013
@@ -27,7 +27,7 @@ public abstract class GenericSegment ext
             throws IOException {
         super(marker, marker_length);
 
-        bytes = readByteArray("Segment Data", marker_length, is,
+        bytes = readBytes("Segment Data", marker_length, is,
                 "Invalid Segment: insufficient data");
     }
 

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pcx/PcxImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pcx/PcxImageParser.java?rev=1441747&r1=1441746&r2=1441747&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pcx/PcxImageParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pcx/PcxImageParser.java Sat Feb  2 13:54:48 2013
@@ -255,7 +255,7 @@ public class PcxImageParser extends Imag
 
     private PcxHeader readPcxHeader(final InputStream is, final boolean isStrict)
             throws ImageReadException, IOException {
-        final byte[] pcxHeaderBytes = readByteArray("PcxHeader", 128, is,
+        final byte[] pcxHeaderBytes = readBytes("PcxHeader", 128, is,
                 "Not a Valid PCX File");
         final int manufacturer = 0xff & pcxHeaderBytes[0];
         final int version = 0xff & pcxHeaderBytes[1];
@@ -344,7 +344,7 @@ public class PcxImageParser extends Imag
     }
 
     private int[] read256ColorPalette(final InputStream stream) throws IOException {
-        final byte[] paletteBytes = readByteArray("Palette", 769, stream,
+        final byte[] paletteBytes = readBytes("Palette", 769, stream,
                 "Error reading palette");
         if (paletteBytes[0] != 12) {
             return null;

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java?rev=1441747&r1=1441746&r2=1441747&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java Sat Feb  2 13:54:48 2013
@@ -175,7 +175,7 @@ public class PngImageParser extends Imag
 
             byte bytes[] = null;
             if (keep) {
-                bytes = readByteArray("Chunk Data", length, is,
+                bytes = readBytes("Chunk Data", length, is,
                         "Not a Valid PNG File: Couldn't read Chunk Data.");
             } else {
                 skipBytes(is, length, "Not a Valid PNG File");

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/ScanExpediter.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/ScanExpediter.java?rev=1441747&r1=1441746&r2=1441747&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/ScanExpediter.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/ScanExpediter.java Sat Feb  2 13:54:48 2013
@@ -228,7 +228,7 @@ public abstract class ScanExpediter exte
             throw new ImageReadException("PNG: missing filter type");
         }
 
-        final byte scanline[] = this.readByteArray("scanline", length, is,
+        final byte scanline[] = this.readBytes("scanline", length, is,
                 "PNG: missing image data");
 
         final byte unfiltered[] = unfilterScanline(filterType, scanline, prev,

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/PsdImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/PsdImageParser.java?rev=1441747&r1=1441746&r2=1441747&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/PsdImageParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/PsdImageParser.java Sat Feb  2 13:54:48 2013
@@ -106,7 +106,7 @@ public class PsdImageParser extends Imag
 
         final int Version = read2Bytes("Version", is, "Not a Valid PSD File");
 
-        final byte Reserved[] = readByteArray("Reserved", 6, is,
+        final byte Reserved[] = readBytes("Reserved", 6, is,
                 "Not a Valid PSD File");
 
         final int Channels = read2Bytes("Channels", is, "Not a Valid PSD File");
@@ -202,7 +202,7 @@ public class PsdImageParser extends Imag
             final int nameLength = readByte("NameLength", is, "Not a Valid PSD File");
 
             available -= 1;
-            final byte nameBytes[] = readByteArray("NameData", nameLength, is,
+            final byte nameBytes[] = readBytes("NameData", nameLength, is,
                     "Not a Valid PSD File");
             available -= nameLength;
             if (((nameLength + 1) % 2) != 0) {
@@ -217,7 +217,7 @@ public class PsdImageParser extends Imag
             // ? DataSize
             // : DataSize + 1; // pad to make even
 
-            final byte Data[] = readByteArray("Data", DataSize, is,
+            final byte Data[] = readBytes("Data", DataSize, is,
                     "Not a Valid PSD File");
             available -= DataSize;
 
@@ -255,7 +255,7 @@ public class PsdImageParser extends Imag
             is.close();
 
             is = this.getInputStream(byteSource, PSD_SECTION_IMAGE_RESOURCES);
-            final byte ImageResources[] = readByteArray("ImageResources",
+            final byte ImageResources[] = readBytes("ImageResources",
                     imageContents.ImageResourcesLength, is,
                     "Not a Valid PSD File");
 
@@ -358,7 +358,7 @@ public class PsdImageParser extends Imag
 
             // PsdHeaderInfo header = readHeader(is);
             if (section == PSD_SECTION_HEADER) {
-                return readByteArray("Header", PSD_HEADER_LENGTH, is,
+                return readBytes("Header", PSD_HEADER_LENGTH, is,
                         "Not a Valid PSD File");
             }
             skipBytes(is, PSD_HEADER_LENGTH);
@@ -367,7 +367,7 @@ public class PsdImageParser extends Imag
                     "Not a Valid PSD File");
 
             if (section == PSD_SECTION_COLOR_MODE) {
-                return readByteArray("ColorModeData", ColorModeDataLength, is,
+                return readBytes("ColorModeData", ColorModeDataLength, is,
                         "Not a Valid PSD File");
             }
 
@@ -379,7 +379,7 @@ public class PsdImageParser extends Imag
                     "Not a Valid PSD File");
 
             if (section == PSD_SECTION_IMAGE_RESOURCES) {
-                return readByteArray("ImageResources", ImageResourcesLength,
+                return readBytes("ImageResources", ImageResourcesLength,
                         is, "Not a Valid PSD File");
             }
 
@@ -391,7 +391,7 @@ public class PsdImageParser extends Imag
                     is, "Not a Valid PSD File");
 
             if (section == PSD_SECTION_LAYER_AND_MASK_DATA) {
-                return readByteArray("LayerAndMaskData",
+                return readBytes("LayerAndMaskData",
                         LayerAndMaskDataLength, is, "Not a Valid PSD File");
             }
 

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/datareaders/CompressedDataReader.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/datareaders/CompressedDataReader.java?rev=1441747&r1=1441746&r2=1441747&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/datareaders/CompressedDataReader.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/datareaders/CompressedDataReader.java Sat Feb  2 13:54:48 2013
@@ -65,7 +65,7 @@ public class CompressedDataReader extend
         for (int channel = 0; channel < channel_count; channel++) {
             for (int y = 0; y < height; y++) {
                 final int index = channel * height + y;
-                final byte packed[] = BinaryFunctions.readByteArray("scanline",
+                final byte packed[] = BinaryFunctions.readBytes("scanline",
                         scanline_bytecounts[index], is,
                         "PSD: Missing Image Data");
 

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffReader.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffReader.java?rev=1441747&r1=1441746&r2=1441747&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffReader.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffReader.java Sat Feb  2 13:54:48 2013
@@ -178,7 +178,7 @@ public class TiffReader extends BinaryFi
                 // Debug.debug("tag*", tag + " (0x" + Integer.toHexString(tag)
                 // + ")");
 
-                final byte valueOffsetBytes[] = readByteArray("ValueOffset", 4, is,
+                final byte valueOffsetBytes[] = readBytes("ValueOffset", 4, is,
                         "Not a Valid TIFF File");
                 final int valueOffset = toInt(valueOffsetBytes);
 

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/wbmp/WbmpImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/wbmp/WbmpImageParser.java?rev=1441747&r1=1441746&r2=1441747&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/wbmp/WbmpImageParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/wbmp/WbmpImageParser.java Sat Feb  2 13:54:48 2013
@@ -207,7 +207,7 @@ public class WbmpImageParser extends Ima
     private BufferedImage readImage(final WbmpHeader wbmpHeader, final InputStream is)
             throws IOException {
         final int rowLength = (wbmpHeader.width + 7) / 8;
-        final byte[] image = readByteArray("Pixels", rowLength * wbmpHeader.height,
+        final byte[] image = readBytes("Pixels", rowLength * wbmpHeader.height,
                 is, "Error reading image pixels");
         final DataBufferByte dataBuffer = new DataBufferByte(image, image.length);
         final WritableRaster raster = WritableRaster.createPackedRaster(dataBuffer,



Mime
View raw message