commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dam...@apache.org
Subject svn commit: r1441735 - in /commons/proper/imaging/trunk/src: main/java/org/apache/commons/imaging/common/ main/java/org/apache/commons/imaging/formats/jpeg/ main/java/org/apache/commons/imaging/formats/jpeg/exif/ main/java/org/apache/commons/imaging/fo...
Date Sat, 02 Feb 2013 11:48:08 GMT
Author: damjan
Date: Sat Feb  2 11:48:07 2013
New Revision: 1441735

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


Added:
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/ByteConversions.java
      - copied, changed from r1441728, commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/BinaryConversions.java
Removed:
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/BinaryConversions.java
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/formats/jpeg/JpegImageParser.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/App14Segment.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/xmp/JpegRewriter.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/xmp/JpegXmpParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/rgbe/RgbeInfo.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeDouble.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeFloat.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeLong.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeRational.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeShort.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoByteOrShort.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoDouble.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoFloat.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoLong.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoRational.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoSLong.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoSRational.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoSShort.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoShort.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoShortOrLong.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoShortOrLongOrRational.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoShortOrRational.java
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/common/BinaryFileFunctionsTest.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=1441735&r1=1441734&r2=1441735&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 11:48:07 2013
@@ -53,23 +53,23 @@ public class BinaryFileParser {
     }
 
     protected final byte[] toBytes(short value) {
-        return BinaryConversions.toBytes(value, byteOrder);
+        return ByteConversions.toBytes(value, byteOrder);
     }
 
     protected final byte[] toBytes(short value, ByteOrder byteOrder) {
-        return BinaryConversions.toBytes(value, byteOrder);
+        return ByteConversions.toBytes(value, byteOrder);
     }
 
     protected final int toInt(final byte bytes[]) {
-        return BinaryConversions.toInt(bytes, byteOrder);
+        return ByteConversions.toInt(bytes, byteOrder);
     }
     
     protected final int toUInt16(final byte[] bytes) {
-        return BinaryConversions.toUInt16(bytes, byteOrder);
+        return ByteConversions.toUInt16(bytes, byteOrder);
     }
 
     public final int toUInt16(final byte bytes[], final int start) {
-        return BinaryConversions.toUInt16(bytes, start, byteOrder);
+        return ByteConversions.toUInt16(bytes, start, byteOrder);
     }
 
     public byte[] getStreamBytes(final InputStream is) throws IOException {
@@ -87,7 +87,7 @@ public class BinaryFileParser {
     }
 
     public final int read2Bytes(final String name, final InputStream is, final String exception)
-            throws ImageReadException, IOException {
+            throws IOException {
         return BinaryFunctions.read2Bytes(name, is, exception, byteOrder);
     }
     
@@ -213,13 +213,13 @@ public class BinaryFileParser {
         return BinaryFunctions.compareByteArrays(a, aStart, b, bStart, length);
     }
     
-    public static boolean byteArrayHasPrefix(final byte bytes[], final BinaryConstant prefix) {
-        if ((bytes == null) || (bytes.length < prefix.size())) {
+    public static boolean startsWith(final byte haystack[], final BinaryConstant needle) {
+        if ((haystack == null) || (haystack.length < needle.size())) {
             return false;
         }
 
-        for (int i = 0; i < prefix.size(); i++) {
-            if (bytes[i] != prefix.get(i)) {
+        for (int i = 0; i < needle.size(); i++) {
+            if (haystack[i] != needle.get(i)) {
                 return false;
             }
         }
@@ -227,17 +227,7 @@ public class BinaryFileParser {
         return true;
     }
 
-    public static boolean byteArrayHasPrefix(final byte bytes[], final byte prefix[]) {
-        if ((bytes == null) || (bytes.length < prefix.length)) {
-            return false;
-        }
-
-        for (int i = 0; i < prefix.length; i++) {
-            if (bytes[i] != prefix[i]) {
-                return false;
-            }
-        }
-
-        return true;
+    public static boolean startsWith(final byte haystack[], final byte needle[]) {
+        return BinaryFunctions.startsWith(haystack, 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=1441735&r1=1441734&r2=1441735&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 11:48:07 2013
@@ -24,7 +24,6 @@ import java.io.PrintWriter;
 import java.io.RandomAccessFile;
 
 import org.apache.commons.imaging.ImageReadException;
-import org.apache.commons.imaging.ImageWriteException;
 
 /**
  * Convenience methods for various binary and I/O operations.
@@ -143,61 +142,6 @@ public class BinaryFunctions {
         return (byte) (0xff & result);
     }
 
-    public static final void writeIntInToByteArray(final int value, final byte bytes[],
-            final int start, final ByteOrder byteOrder) {
-        if (byteOrder == ByteOrder.MOTOROLA) {
-            bytes[start + 0] = (byte) (value >> 24);
-            bytes[start + 1] = (byte) (value >> 16);
-            bytes[start + 2] = (byte) (value >> 8);
-            bytes[start + 3] = (byte) (value >> 0);
-        } else {
-            bytes[start + 3] = (byte) (value >> 24);
-            bytes[start + 2] = (byte) (value >> 16);
-            bytes[start + 1] = (byte) (value >> 8);
-            bytes[start + 0] = (byte) (value >> 0);
-        }
-    }
-
-    public static final byte[] int2ToByteArray(final int value, final ByteOrder byteOrder) {
-        if (byteOrder == ByteOrder.MOTOROLA) {
-            return new byte[] { (byte) (value >> 8), (byte) (value >> 0), };
-        } else {
-            return new byte[] { (byte) (value >> 0), (byte) (value >> 8), };
-        }
-    }
-
-    public static final byte[] convertShortToByteArray(final int value, final ByteOrder byteOrder) {
-        final byte result[] = new byte[2];
-
-        if (byteOrder == ByteOrder.MOTOROLA) {
-            result[0] = (byte) (value >> 8);
-            result[1] = (byte) (value >> 0);
-        } else {
-            result[1] = (byte) (value >> 8);
-            result[0] = (byte) (value >> 0);
-        }
-
-        return result;
-    }
-
-    public static final byte[] convertIntArrayToRationalArray(final int numerators[],
-            final int denominators[], final ByteOrder byteOrder) throws ImageWriteException {
-        if (numerators.length != denominators.length) {
-            throw new ImageWriteException("numerators.length ("
-                    + numerators.length + " != denominators.length ("
-                    + denominators.length + ")");
-        }
-
-        final byte result[] = new byte[numerators.length * 8];
-
-        for (int i = 0; i < numerators.length; i++) {
-            writeIntInToByteArray(numerators[i], result, i * 8, byteOrder);
-            writeIntInToByteArray(denominators[i], result, i * 8 + 4, byteOrder);
-        }
-
-        return result;
-    }
-
     public static final byte[] readByteArray(final String name, final int length, final InputStream is)
             throws IOException {
         final String exception = name + " could not be read.";
@@ -239,7 +183,7 @@ public class BinaryFunctions {
         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[] getByteArrayHead(final String name, final byte bytes[], final int count)
             throws ImageReadException {
         return readBytearray(name, bytes, 0, bytes.length - count);
     }
@@ -365,8 +309,7 @@ public class BinaryFunctions {
     }
 
     public static final int read2Bytes(final String name, final InputStream is,
-            final String exception, final ByteOrder byteOrder) throws ImageReadException,
-            IOException {
+            final String exception, final ByteOrder byteOrder) throws IOException {
         final int byte0 = is.read();
         final int byte1 = is.read();
         if ((byte0 | byte1) < 0) {

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=1441735&r1=1441734&r2=1441735&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 11:48:07 2013
@@ -66,7 +66,7 @@ public class BinaryInputStream extends I
 
     public final int read4Bytes(final String name, final String exception)
             throws IOException {
-        return read4Bytes(name, exception, byteOrder);
+        return BinaryFunctions.read4Bytes(name, is, exception, byteOrder);
     }
 
     public final void debugNumber(final String msg, final int data) {
@@ -90,156 +90,31 @@ public class BinaryInputStream extends I
 
     public final void readAndVerifyBytes(final byte expected[], final String exception)
             throws ImageReadException, IOException {
-        for (int i = 0; i < expected.length; i++) {
-            final int data = is.read();
-            final byte b = (byte) (0xff & data);
-
-            if ((data < 0) || (b != expected[i])) {
-                System.out.println("i" + ": " + i);
-
-                this.debugByteArray("expected", expected);
-                debugNumber("data[" + i + "]", b);
-                // debugNumber("expected[" + i + "]", expected[i]);
-
-                throw new ImageReadException(exception);
-            }
-        }
+        BinaryFunctions.readAndVerifyBytes(is, expected, exception);
     }
 
     protected final void readAndVerifyBytes(final String name, final byte expected[],
             final String exception) throws ImageReadException, IOException {
-        final byte bytes[] = readByteArray(name, expected.length, exception);
-
-        for (int i = 0; i < expected.length; i++) {
-            if (bytes[i] != expected[i]) {
-                System.out.println("i" + ": " + i);
-                debugNumber("bytes[" + i + "]", bytes[i]);
-                debugNumber("expected[" + i + "]", expected[i]);
-
-                throw new ImageReadException(exception);
-            }
-        }
+        BinaryFunctions.readAndVerifyBytes(name, is, expected, exception);
     }
 
     public final void skipBytes(final int length, final String exception)
             throws IOException {
-        long total = 0;
-        while (length != total) {
-            final long skipped = is.skip(length - total);
-            if (skipped < 1) {
-                throw new IOException(exception + " (" + skipped + ")");
-            }
-            total += skipped;
-        }
+        BinaryFunctions.skipBytes(is, length, exception);
     }
 
     protected final void scanForByte(final byte value) throws IOException {
-        int count = 0;
-        for (int i = 0; count < 3; i++) {
-            final int b = is.read();
-            if (b < 0) {
-                return;
-            }
-            if ((0xff & b) == value) {
-                System.out.println("\t" + i + ": match.");
-                count++;
-            }
-        }
+        BinaryFunctions.scanForByte(is, value);
     }
 
     public final byte readByte(final String name, final String exception)
             throws IOException {
-        final int result = is.read();
-
-        if ((result < 0)) {
-            System.out.println(name + ": " + result);
-            throw new IOException(exception);
-        }
-
-        if (debug) {
-            debugNumber(name, result);
-        }
-
-        return (byte) (0xff & result);
-    }
-
-    protected final int convertByteArrayToInt(final String name, final byte bytes[],
-            final ByteOrder byteOrder) {
-        return convertByteArrayToInt(name, bytes, 0, 4, byteOrder);
-    }
-
-    protected final int convertByteArrayToInt(final String name, final byte bytes[],
-            final int start, final int length, final ByteOrder byteOrder) {
-        final byte byte0 = bytes[start + 0];
-        final byte byte1 = bytes[start + 1];
-        final byte byte2 = bytes[start + 2];
-        byte byte3 = 0;
-        if (length == 4) {
-            byte3 = bytes[start + 3];
-        }
-
-        int result;
-
-        if (byteOrder == ByteOrder.MOTOROLA) {
-            result = ((0xff & byte0) << 24) + ((0xff & byte1) << 16)
-                    + ((0xff & byte2) << 8) + ((0xff & byte3) << 0);
-        } else {
-            result = ((0xff & byte3) << 24) + ((0xff & byte2) << 16)
-                    + ((0xff & byte1) << 8) + ((0xff & byte0) << 0);
-        }
-
-        if (debug) {
-            debugNumber(name, result, 4);
-        }
-
-        return result;
-    }
-
-    protected final int convertByteArrayToShort(final String name, final byte bytes[],
-            final ByteOrder byteOrder) {
-        return convertByteArrayToShort(name, 0, bytes, byteOrder);
-    }
-
-    protected final int convertByteArrayToShort(final String name, final int start,
-            final byte bytes[], final ByteOrder byteOrder) {
-        final byte byte0 = bytes[start + 0];
-        final byte byte1 = bytes[start + 1];
-
-        int result;
-
-        if (byteOrder == ByteOrder.MOTOROLA) {
-            result = ((0xff & byte0) << 8) + ((0xff & byte1) << 0);
-        } else {
-            result = ((0xff & byte1) << 8) + ((0xff & byte0) << 0);
-        }
-
-        if (debug) {
-            debugNumber(name, result, 2);
-        }
-
-        return result;
+        return BinaryFunctions.readByte(name, is, exception);
     }
 
     public final byte[] readByteArray(final String name, final int length, final String exception)
             throws IOException {
-        final byte result[] = new byte[length];
-
-        int read = 0;
-        while (read < length) {
-            final int count = is.read(result, read, length - read);
-            if (count < 1) {
-                throw new IOException(exception);
-            }
-
-            read += count;
-        }
-
-        if (debug) {
-            for (int i = 0; ((i < length) && (i < 150)); i++) {
-                debugNumber(name + " (" + i + ")", 0xff & result[i]);
-            }
-        }
-        return result;
+        return BinaryFunctions.readByteArray(name, length, is, exception);
     }
 
     protected final void debugByteArray(final String name, final byte bytes[]) {
@@ -259,26 +134,13 @@ public class BinaryInputStream extends I
     }
 
     public final byte[] readBytearray(final String name, 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);
-
-        if (debug) {
-            debugByteArray(name, result);
-        }
-
-        return result;
+            final int count) throws ImageReadException {
+        return BinaryFunctions.readBytearray(name, bytes, start, count);
     }
 
     public final byte[] readByteArray(final int length, final String error)
             throws ImageReadException, IOException {
-        final boolean verbose = false;
-        final boolean strict = true;
-        return readByteArray(length, error, verbose, strict);
+        return BinaryFunctions.readByteArray("", length, is, error);
     }
 
     public final byte[] readByteArray(final int length, final String error,
@@ -301,188 +163,76 @@ public class BinaryInputStream extends I
         return bytes;
     }
 
-    protected final byte[] getBytearrayTail(final String name, final byte bytes[], final int count) {
-        return readBytearray(name, bytes, count, bytes.length - count);
+    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) {
-        return readBytearray(name, bytes, 0, bytes.length - 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[],
             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]) {
-                debugNumber("a[" + (aStart + i) + "]", a[aStart + i]);
-                debugNumber("b[" + (bStart + i) + "]", b[bStart + i]);
-
-                return false;
-            }
-        }
-
-        return true;
+        return BinaryFunctions.compareByteArrays(a, aStart, b, bStart, length);
     }
 
     protected final int read4Bytes(final String name, final String exception, final ByteOrder byteOrder)
             throws IOException {
-        final int size = 4;
-        final byte bytes[] = new byte[size];
-
-        int read = 0;
-        while (read < size) {
-            final int count = is.read(bytes, read, size - read);
-            if (count < 1) {
-                throw new IOException(exception);
-            }
-
-            read += count;
-        }
-
-        return convertByteArrayToInt(name, bytes, byteOrder);
+        return BinaryFunctions.read4Bytes(name, is, exception, byteOrder);
+    }
+    
+    public final int read4Bytes(final String exception) throws IOException {
+        return BinaryFunctions.read4Bytes("", is, exception, byteOrder);
     }
 
     protected final int read3Bytes(final String name, final String exception, final ByteOrder byteOrder)
             throws IOException {
-        final int size = 3;
-        final byte bytes[] = new byte[size];
-
-        int read = 0;
-        while (read < size) {
-            final int count = is.read(bytes, read, size - read);
-            if (count < 1) {
-                throw new IOException(exception);
-            }
-
-            read += count;
-        }
-
-        return convertByteArrayToInt(name, bytes, 0, 3, byteOrder);
-
+        return BinaryFunctions.read3Bytes(name, is, exception, byteOrder);
     }
 
     protected final int read2Bytes(final String name, final String exception, final ByteOrder byteOrder)
             throws IOException {
-        final int size = 2;
-        final byte bytes[] = new byte[size];
-
-        int read = 0;
-        while (read < size) {
-            final int count = is.read(bytes, read, size - read);
-            if (count < 1) {
-                throw new IOException(exception);
-            }
-
-            read += count;
-        }
-
-        return convertByteArrayToShort(name, bytes, byteOrder);
+        return BinaryFunctions.read2Bytes(name, is, exception, byteOrder);
     }
-
-    public final int read1ByteInteger(final String exception)
-            throws ImageReadException, IOException {
-        final int byte0 = is.read();
-        if (byte0 < 0) {
-            throw new ImageReadException(exception);
-        }
-
-        return 0xff & byte0;
-    }
-
-    public final int read2ByteInteger(final String exception)
-            throws ImageReadException, IOException {
-        final int byte0 = is.read();
-        final int byte1 = is.read();
-        if ((byte0 | byte1) < 0) {
-            throw new ImageReadException(exception);
-        }
-
-        if (byteOrder == ByteOrder.MOTOROLA) {
-            return ((0xff & byte0) << 8) + ((0xff & byte1) << 0);
-        } else {
-            return ((0xff & byte1) << 8) + ((0xff & byte0) << 0);
-        }
+    
+    public final int read2Bytes(final String exception) throws IOException {
+        return BinaryFunctions.read2Bytes("", is, exception, byteOrder);
     }
 
-    public final int read4ByteInteger(final String exception)
+    public final int read1ByteInteger(final String exception)
             throws ImageReadException, IOException {
-        final int byte0 = is.read();
-        final int byte1 = is.read();
-        final int byte2 = is.read();
-        final int byte3 = is.read();
-        if ((byte0 | byte1 | byte2 | byte3) < 0) {
-            throw new ImageReadException(exception);
-        }
-
-        if (byteOrder == ByteOrder.MOTOROLA) {
-            return ((0xff & byte0) << 24) + ((0xff & byte1) << 16)
-                    + ((0xff & byte2) << 8) + ((0xff & byte3) << 0);
-        } else {
-            return ((0xff & byte3) << 24) + ((0xff & byte2) << 16)
-                    + ((0xff & byte1) << 8) + ((0xff & byte0) << 0);
-        }
+        return BinaryFunctions.readByte("", is, exception);
     }
 
     protected final void printCharQuad(final String msg, final int i) {
-        System.out.println(msg + ": '" + (char) (0xff & (i >> 24))
-                + (char) (0xff & (i >> 16)) + (char) (0xff & (i >> 8))
-                + (char) (0xff & (i >> 0)) + "'");
+        BinaryFunctions.printCharQuad(msg, i);
     }
 
     protected final void printByteBits(final String msg, final byte i) {
-        System.out.println(msg + ": '" + Integer.toBinaryString(0xff & i));
+        BinaryFunctions.printByteBits(msg, i);
     }
 
     protected final static int charsToQuad(final char c1, final char c2, final char c3, final char c4) {
-        return (((0xff & c1) << 24) | ((0xff & c2) << 16) | ((0xff & c3) << 8) | ((0xff & c4) << 0));
+        return BinaryFunctions.charsToQuad(c1, c2, c3, c4);
     }
 
     public final int findNull(final byte src[]) {
-        return findNull(src, 0);
+        return BinaryFunctions.findNull(src);
     }
 
     public final int findNull(final byte src[], final int start) {
-        for (int i = start; i < src.length; i++) {
-            if (src[i] == 0) {
-                return i;
-            }
-        }
-        return -1;
+        return BinaryFunctions.findNull(src, start);
     }
 
     protected final byte[] getRAFBytes(final RandomAccessFile raf, final long pos,
             final int length, final String exception) throws IOException {
-        final byte result[] = new byte[length];
-
-        if (debug) {
-            System.out.println("getRAFBytes pos" + ": " + pos);
-            System.out.println("getRAFBytes length" + ": " + length);
-        }
-
-        raf.seek(pos);
-
-        int read = 0;
-        while (read < length) {
-            final int count = raf.read(result, read, length - read);
-            if (count < 1) {
-                throw new IOException(exception);
-            }
-
-            read += count;
-        }
-
-        return result;
-
+        return BinaryFunctions.getRAFBytes(raf, pos, length, exception);
     }
 
     protected void skipBytes(final int length) throws IOException {
-        skipBytes(length, "Couldn't skip bytes");
+        BinaryFunctions.skipBytes(is, length);
     }
 
 }

Copied: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/ByteConversions.java (from r1441728, commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/BinaryConversions.java)
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/ByteConversions.java?p2=commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/ByteConversions.java&p1=commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/BinaryConversions.java&r1=1441728&r2=1441735&rev=1441735&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/BinaryConversions.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/ByteConversions.java Sat Feb  2 11:48:07 2013
@@ -20,7 +20,7 @@ package org.apache.commons.imaging.commo
  * Convenience methods for converting data types to and from
  * byte arrays.
  */
-public class BinaryConversions {
+public class ByteConversions {
     public static byte[] toBytes(final short value, final ByteOrder byteOrder) {
         final byte[] result = new byte[2];
         toBytes(value, byteOrder, result, 0);

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=1441735&r1=1441734&r2=1441735&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 11:48:07 2013
@@ -321,7 +321,7 @@ public class JpegImageParser extends Ima
     }
 
     public static boolean isExifAPP1Segment(final GenericSegment segment) {
-        return byteArrayHasPrefix(segment.bytes, EXIF_IDENTIFIER_CODE);
+        return startsWith(segment.bytes, EXIF_IDENTIFIER_CODE);
     }
 
     private List<Segment> filterAPP1Segments(final List<Segment> v) {
@@ -416,7 +416,7 @@ public class JpegImageParser extends Ima
                 }
 
                 if (marker == JPEG_APP1_Marker) {
-                    if (byteArrayHasPrefix(segmentData, EXIF_IDENTIFIER_CODE)) {
+                    if (startsWith(segmentData, EXIF_IDENTIFIER_CODE)) {
                         result[0] = true;
                         return false;
                     }

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=1441735&r1=1441734&r2=1441735&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 11:48:07 2013
@@ -160,7 +160,7 @@ public class ExifRewriter extends Binary
                 if (marker != JPEG_APP1_Marker) {
                     pieces.add(new JFIFPieceSegment(marker, markerBytes,
                             markerLengthBytes, segmentData));
-                } else if (!byteArrayHasPrefix(segmentData,
+                } else if (!startsWith(segmentData,
                         EXIF_IDENTIFIER_CODE)) {
                     pieces.add(new JFIFPieceSegment(marker, markerBytes,
                             markerLengthBytes, segmentData));

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=1441735&r1=1441734&r2=1441735&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 11:48:07 2013
@@ -43,7 +43,7 @@ public class IptcParser extends BinaryFi
     }
 
     public boolean isPhotoshopJpegSegment(final byte segmentData[]) {
-        if (!BinaryFileParser.byteArrayHasPrefix(segmentData,
+        if (!BinaryFileParser.startsWith(segmentData,
                 PHOTOSHOP_IDENTIFICATION_STRING)) {
             return false;
         }
@@ -296,7 +296,7 @@ public class IptcParser extends BinaryFi
                 }
     
                 final int blockType = bis
-                        .read2ByteInteger("Image Resource Block missing type");
+                        .read2Bytes("Image Resource Block missing type");
                 if (verbose) {
                     Debug.debug("blockType",
                             blockType + " (0x" + Integer.toHexString(blockType)
@@ -326,7 +326,7 @@ public class IptcParser extends BinaryFi
                 }
     
                 final int blockSize = bis
-                        .read4ByteInteger("Image Resource Block missing size");
+                        .read4Bytes("Image Resource Block missing size");
                 if (verbose) {
                     Debug.debug("blockSize",
                             blockSize + " (0x" + Integer.toHexString(blockSize)

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/segments/App14Segment.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/segments/App14Segment.java?rev=1441735&r1=1441734&r2=1441735&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/segments/App14Segment.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/segments/App14Segment.java Sat Feb  2 11:48:07 2013
@@ -53,7 +53,7 @@ public class App14Segment extends AppnSe
     }
 
     public boolean isAdobeJpegSegment() {
-        return BinaryFileParser.byteArrayHasPrefix(bytes, adobePrefix);
+        return BinaryFileParser.startsWith(bytes, adobePrefix);
     }
 
     public int getAdobeColorTransform() {

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=1441735&r1=1441734&r2=1441735&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 11:48:07 2013
@@ -37,7 +37,7 @@ public class App2Segment extends AppnSeg
             throws ImageReadException, IOException {
         super(marker, marker_length, is2);
 
-        if (BinaryFileParser.byteArrayHasPrefix(bytes,
+        if (BinaryFileParser.startsWith(bytes,
                 JpegImageParser.icc_profile_label)) {
             final InputStream is = new ByteArrayInputStream(bytes);
 

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/xmp/JpegRewriter.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/xmp/JpegRewriter.java?rev=1441735&r1=1441734&r2=1441735&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/xmp/JpegRewriter.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/xmp/JpegRewriter.java Sat Feb  2 11:48:07 2013
@@ -23,7 +23,7 @@ import java.util.List;
 
 import org.apache.commons.imaging.ImageReadException;
 import org.apache.commons.imaging.ImageWriteException;
-import org.apache.commons.imaging.common.BinaryConversions;
+import org.apache.commons.imaging.common.ByteConversions;
 import org.apache.commons.imaging.common.BinaryFileParser;
 import org.apache.commons.imaging.common.ByteOrder;
 import org.apache.commons.imaging.common.bytesource.ByteSource;
@@ -74,8 +74,8 @@ public class JpegRewriter extends Binary
 
         public JFIFPieceSegment(final int marker, final byte[] segmentData) {
             this(marker,
-                    BinaryConversions.toBytes((short)marker, JPEG_BYTE_ORDER),
-                    BinaryConversions.toBytes((short)(segmentData.length + 2), JPEG_BYTE_ORDER),
+                    ByteConversions.toBytes((short)marker, JPEG_BYTE_ORDER),
+                    ByteConversions.toBytes((short)(segmentData.length + 2), JPEG_BYTE_ORDER),
                     segmentData);
         }
 
@@ -112,7 +112,7 @@ public class JpegRewriter extends Binary
             if (marker != JPEG_APP1_Marker) {
                 return false;
             }
-            if (!byteArrayHasPrefix(segmentData, EXIF_IDENTIFIER_CODE)) {
+            if (!startsWith(segmentData, EXIF_IDENTIFIER_CODE)) {
                 return false;
             }
             return true;
@@ -132,7 +132,7 @@ public class JpegRewriter extends Binary
             if (marker != JPEG_APP1_Marker) {
                 return false;
             }
-            if (!byteArrayHasPrefix(segmentData, XMP_IDENTIFIER)) {
+            if (!startsWith(segmentData, XMP_IDENTIFIER)) {
                 return false;
             }
             return true;

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/xmp/JpegXmpParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/xmp/JpegXmpParser.java?rev=1441735&r1=1441734&r2=1441735&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/xmp/JpegXmpParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/xmp/JpegXmpParser.java Sat Feb  2 11:48:07 2013
@@ -31,7 +31,7 @@ public class JpegXmpParser extends Binar
     }
 
     public boolean isXmpJpegSegment(final byte segmentData[]) {
-        return BinaryFileParser.byteArrayHasPrefix(segmentData, XMP_IDENTIFIER);
+        return BinaryFileParser.startsWith(segmentData, XMP_IDENTIFIER);
     }
 
     public String parseXmpJpegSegment(final byte segmentData[])

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/rgbe/RgbeInfo.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/rgbe/RgbeInfo.java?rev=1441735&r1=1441734&r2=1441735&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/rgbe/RgbeInfo.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/rgbe/RgbeInfo.java Sat Feb  2 11:48:07 2013
@@ -24,6 +24,7 @@ import java.util.regex.Pattern;
 import org.apache.commons.imaging.ImageReadException;
 import org.apache.commons.imaging.common.BinaryFunctions;
 import org.apache.commons.imaging.common.BinaryInputStream;
+import org.apache.commons.imaging.common.ByteConversions;
 import org.apache.commons.imaging.common.ByteOrder;
 import org.apache.commons.imaging.common.IImageMetadata;
 import org.apache.commons.imaging.common.ImageMetadata;
@@ -141,7 +142,7 @@ class RgbeInfo extends BinaryFunctions {
                     "Scan lines must be less than 32768 bytes long");
         }
 
-        final byte[] scanLineBytes = convertShortToByteArray(width,
+        final byte[] scanLineBytes = ByteConversions.toBytes((short)width,
                 ByteOrder.BIG_ENDIAN);
         final byte[] rgbe = new byte[width * 4];
         final float[][] out = new float[3][width * height];

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeDouble.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeDouble.java?rev=1441735&r1=1441734&r2=1441735&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeDouble.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeDouble.java Sat Feb  2 11:48:07 2013
@@ -17,7 +17,7 @@
 package org.apache.commons.imaging.formats.tiff.fieldtypes;
 
 import org.apache.commons.imaging.ImageWriteException;
-import org.apache.commons.imaging.common.BinaryConversions;
+import org.apache.commons.imaging.common.ByteConversions;
 import org.apache.commons.imaging.common.ByteOrder;
 import org.apache.commons.imaging.formats.tiff.TiffField;
 import org.apache.commons.imaging.util.Debug;
@@ -35,18 +35,18 @@ public class FieldTypeDouble extends Fie
     @Override
     public byte[] writeData(final Object o, final ByteOrder byteOrder) throws ImageWriteException {
         if (o instanceof Double) {
-            return BinaryConversions.toBytes(((Double) o).doubleValue(),
+            return ByteConversions.toBytes(((Double) o).doubleValue(),
                     byteOrder);
         } else if (o instanceof double[]) {
             final double numbers[] = (double[]) o;
-            return BinaryConversions.toBytes(numbers, byteOrder);
+            return ByteConversions.toBytes(numbers, byteOrder);
         } else if (o instanceof Double[]) {
             final Double numbers[] = (Double[]) o;
             final double values[] = new double[numbers.length];
             for (int i = 0; i < values.length; i++) {
                 values[i] = numbers[i].doubleValue();
             }
-            return BinaryConversions.toBytes(values, byteOrder);
+            return ByteConversions.toBytes(values, byteOrder);
         } else {
             throw new ImageWriteException("Invalid data: " + o + " ("
                     + Debug.getType(o) + ")");

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeFloat.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeFloat.java?rev=1441735&r1=1441734&r2=1441735&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeFloat.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeFloat.java Sat Feb  2 11:48:07 2013
@@ -17,7 +17,7 @@
 package org.apache.commons.imaging.formats.tiff.fieldtypes;
 
 import org.apache.commons.imaging.ImageWriteException;
-import org.apache.commons.imaging.common.BinaryConversions;
+import org.apache.commons.imaging.common.ByteConversions;
 import org.apache.commons.imaging.common.ByteOrder;
 import org.apache.commons.imaging.formats.tiff.TiffField;
 import org.apache.commons.imaging.util.Debug;
@@ -32,29 +32,29 @@ public class FieldTypeFloat extends Fiel
     @Override
     public Object getSimpleValue(final TiffField entry) {
         if (entry.length == 1) {
-            return new Float(BinaryConversions.toFloat(
+            return new Float(ByteConversions.toFloat(
                     entry.valueOffsetBytes,
                     entry.byteOrder));
         }
 
-        return BinaryConversions.toFloats(getRawBytes(entry), 0, 4*entry.length,
+        return ByteConversions.toFloats(getRawBytes(entry), 0, 4*entry.length,
                 entry.byteOrder);
     }
 
     @Override
     public byte[] writeData(final Object o, final ByteOrder byteOrder) throws ImageWriteException {
         if (o instanceof Float) {
-            return BinaryConversions.toBytes(((Float) o).floatValue(), byteOrder);
+            return ByteConversions.toBytes(((Float) o).floatValue(), byteOrder);
         } else if (o instanceof float[]) {
             final float numbers[] = (float[]) o;
-            return BinaryConversions.toBytes(numbers, byteOrder);
+            return ByteConversions.toBytes(numbers, byteOrder);
         } else if (o instanceof Float[]) {
             final Float numbers[] = (Float[]) o;
             final float values[] = new float[numbers.length];
             for (int i = 0; i < values.length; i++) {
                 values[i] = numbers[i].floatValue();
             }
-            return BinaryConversions.toBytes(values, byteOrder);
+            return ByteConversions.toBytes(values, byteOrder);
         } else {
             throw new ImageWriteException("Invalid data: " + o + " ("
                     + Debug.getType(o) + ")");

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeLong.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeLong.java?rev=1441735&r1=1441734&r2=1441735&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeLong.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeLong.java Sat Feb  2 11:48:07 2013
@@ -17,7 +17,7 @@
 package org.apache.commons.imaging.formats.tiff.fieldtypes;
 
 import org.apache.commons.imaging.ImageWriteException;
-import org.apache.commons.imaging.common.BinaryConversions;
+import org.apache.commons.imaging.common.ByteConversions;
 import org.apache.commons.imaging.common.ByteOrder;
 import org.apache.commons.imaging.formats.tiff.TiffField;
 import org.apache.commons.imaging.util.Debug;
@@ -30,28 +30,28 @@ public class FieldTypeLong extends Field
     @Override
     public Object getSimpleValue(final TiffField entry) {
         if (entry.length == 1) {
-            return BinaryConversions.toInt(
+            return ByteConversions.toInt(
                     entry.valueOffsetBytes, entry.byteOrder);
         }
 
-        return BinaryConversions.toInts(getRawBytes(entry), 0, 4*entry.length,
+        return ByteConversions.toInts(getRawBytes(entry), 0, 4*entry.length,
                 entry.byteOrder);
     }
 
     @Override
     public byte[] writeData(final Object o, final ByteOrder byteOrder) throws ImageWriteException {
         if (o instanceof Integer) {
-            return BinaryConversions.toBytes(((Integer)o).intValue(), byteOrder);
+            return ByteConversions.toBytes(((Integer)o).intValue(), byteOrder);
         } else if (o instanceof int[]) {
             final int numbers[] = (int[]) o;
-            return BinaryConversions.toBytes(numbers, byteOrder);
+            return ByteConversions.toBytes(numbers, byteOrder);
         } else if (o instanceof Integer[]) {
             final Integer numbers[] = (Integer[]) o;
             final int values[] = new int[numbers.length];
             for (int i = 0; i < values.length; i++) {
                 values[i] = numbers[i].intValue();
             }
-            return BinaryConversions.toBytes(values, byteOrder);
+            return ByteConversions.toBytes(values, byteOrder);
         } else {
             throw new ImageWriteException("Invalid data: " + o + " ("
                     + Debug.getType(o) + ")");

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeRational.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeRational.java?rev=1441735&r1=1441734&r2=1441735&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeRational.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeRational.java Sat Feb  2 11:48:07 2013
@@ -17,7 +17,7 @@
 package org.apache.commons.imaging.formats.tiff.fieldtypes;
 
 import org.apache.commons.imaging.ImageWriteException;
-import org.apache.commons.imaging.common.BinaryConversions;
+import org.apache.commons.imaging.common.ByteConversions;
 import org.apache.commons.imaging.common.ByteOrder;
 import org.apache.commons.imaging.common.RationalNumber;
 import org.apache.commons.imaging.common.RationalNumberUtilities;
@@ -32,25 +32,25 @@ public class FieldTypeRational extends F
     @Override
     public Object getSimpleValue(final TiffField entry) {
         if (entry.length == 1) {
-            return BinaryConversions.toRational(entry.oversizeValue, entry.byteOrder);
+            return ByteConversions.toRational(entry.oversizeValue, entry.byteOrder);
         }
 
-        return BinaryConversions.toRationals(getRawBytes(entry), 0, 8*entry.length,
+        return ByteConversions.toRationals(getRawBytes(entry), 0, 8*entry.length,
                 entry.byteOrder);
     }
 
     @Override
     public byte[] writeData(final Object o, final ByteOrder byteOrder) throws ImageWriteException {
         if (o instanceof RationalNumber) {
-            return BinaryConversions.toBytes((RationalNumber) o, byteOrder);
+            return ByteConversions.toBytes((RationalNumber) o, byteOrder);
         } else if (o instanceof RationalNumber[]) {
-            return BinaryConversions.toBytes((RationalNumber[]) o,
+            return ByteConversions.toBytes((RationalNumber[]) o,
                     byteOrder);
         } else if (o instanceof Number) {
             final Number number = (Number) o;
             final RationalNumber rationalNumber = RationalNumberUtilities
                     .getRationalNumber(number.doubleValue());
-            return BinaryConversions.toBytes(rationalNumber, byteOrder);
+            return ByteConversions.toBytes(rationalNumber, byteOrder);
         } else if (o instanceof Number[]) {
             final Number numbers[] = (Number[]) o;
             final RationalNumber rationalNumbers[] = new RationalNumber[numbers.length];
@@ -59,7 +59,7 @@ public class FieldTypeRational extends F
                 rationalNumbers[i] = RationalNumberUtilities
                         .getRationalNumber(number.doubleValue());
             }
-            return BinaryConversions.toBytes(rationalNumbers, byteOrder);
+            return ByteConversions.toBytes(rationalNumbers, byteOrder);
         } else if (o instanceof double[]) {
             final double numbers[] = (double[]) o;
             final RationalNumber rationalNumbers[] = new RationalNumber[numbers.length];
@@ -68,22 +68,10 @@ public class FieldTypeRational extends F
                 rationalNumbers[i] = RationalNumberUtilities
                         .getRationalNumber(number);
             }
-            return BinaryConversions.toBytes(rationalNumbers, byteOrder);
+            return ByteConversions.toBytes(rationalNumbers, byteOrder);
         } else {
             throw new ImageWriteException("Invalid data: " + o + " ("
                     + Debug.getType(o) + ")");
         }
     }
-
-    public byte[] writeData(final int numerator, final int denominator, final ByteOrder byteOrder)
-            throws ImageWriteException {
-        return writeData(new int[] { numerator }, new int[] { denominator },
-                byteOrder);
-    }
-
-    public byte[] writeData(final int numerators[], final int denominators[], final ByteOrder byteOrder)
-            throws ImageWriteException {
-        return convertIntArrayToRationalArray(numerators, denominators,
-                byteOrder);
-    }
 }

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeShort.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeShort.java?rev=1441735&r1=1441734&r2=1441735&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeShort.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/fieldtypes/FieldTypeShort.java Sat Feb  2 11:48:07 2013
@@ -18,7 +18,7 @@ package org.apache.commons.imaging.forma
 
 import org.apache.commons.imaging.ImageReadException;
 import org.apache.commons.imaging.ImageWriteException;
-import org.apache.commons.imaging.common.BinaryConversions;
+import org.apache.commons.imaging.common.ByteConversions;
 import org.apache.commons.imaging.common.ByteOrder;
 import org.apache.commons.imaging.formats.tiff.TiffField;
 import org.apache.commons.imaging.util.Debug;
@@ -31,29 +31,29 @@ public class FieldTypeShort extends Fiel
     @Override
     public Object getSimpleValue(final TiffField entry) throws ImageReadException {
         if (entry.length == 1) {
-            return BinaryConversions.toShort(entry.valueOffsetBytes,
+            return ByteConversions.toShort(entry.valueOffsetBytes,
                     entry.byteOrder);
         }
 
-        return BinaryConversions.toShorts(getRawBytes(entry),
+        return ByteConversions.toShorts(getRawBytes(entry),
                 entry.byteOrder);
     }
 
     @Override
     public byte[] writeData(final Object o, final ByteOrder byteOrder) throws ImageWriteException {
         if (o instanceof Short) {
-            return BinaryConversions.toBytes(
+            return ByteConversions.toBytes(
                     ((Short)o).shortValue(), byteOrder);
         } else if (o instanceof short[]) {
             final short numbers[] = (short[]) o;
-            return BinaryConversions.toBytes(numbers, byteOrder);
+            return ByteConversions.toBytes(numbers, byteOrder);
         } else if (o instanceof Short[]) {
             final Short numbers[] = (Short[]) o;
             final short values[] = new short[numbers.length];
             for (int i = 0; i < values.length; i++) {
                 values[i] = numbers[i].shortValue();
             }
-            return BinaryConversions.toBytes(values, byteOrder);
+            return ByteConversions.toBytes(values, byteOrder);
         } else {
             throw new ImageWriteException("Invalid data: " + o + " ("
                     + Debug.getType(o) + ")");

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoByteOrShort.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoByteOrShort.java?rev=1441735&r1=1441734&r2=1441735&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoByteOrShort.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoByteOrShort.java Sat Feb  2 11:48:07 2013
@@ -16,7 +16,7 @@
  */
 package org.apache.commons.imaging.formats.tiff.taginfos;
 
-import org.apache.commons.imaging.common.BinaryConversions;
+import org.apache.commons.imaging.common.ByteConversions;
 import org.apache.commons.imaging.common.ByteOrder;
 import org.apache.commons.imaging.formats.tiff.constants.TiffDirectoryType;
 
@@ -30,6 +30,6 @@ public class TagInfoByteOrShort extends 
     }
     
     public byte[] encodeValue(final ByteOrder byteOrder, final short... values) {
-        return BinaryConversions.toBytes(values, byteOrder);
+        return ByteConversions.toBytes(values, byteOrder);
     }
 }

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoDouble.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoDouble.java?rev=1441735&r1=1441734&r2=1441735&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoDouble.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoDouble.java Sat Feb  2 11:48:07 2013
@@ -17,7 +17,7 @@
 package org.apache.commons.imaging.formats.tiff.taginfos;
 
 import org.apache.commons.imaging.ImageWriteException;
-import org.apache.commons.imaging.common.BinaryConversions;
+import org.apache.commons.imaging.common.ByteConversions;
 import org.apache.commons.imaging.common.ByteOrder;
 import org.apache.commons.imaging.formats.tiff.constants.TiffDirectoryType;
 
@@ -27,10 +27,10 @@ public class TagInfoDouble extends TagIn
     }
     
     public double[] getValue(final ByteOrder byteOrder, final byte[] bytes) {
-        return BinaryConversions.toDoubles(bytes, byteOrder);
+        return ByteConversions.toDoubles(bytes, byteOrder);
     }
     
     public byte[] encodeValue(final ByteOrder byteOrder, final double... values) throws ImageWriteException {
-        return BinaryConversions.toBytes(values, byteOrder);
+        return ByteConversions.toBytes(values, byteOrder);
     }
 }

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoFloat.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoFloat.java?rev=1441735&r1=1441734&r2=1441735&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoFloat.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoFloat.java Sat Feb  2 11:48:07 2013
@@ -17,7 +17,7 @@
 package org.apache.commons.imaging.formats.tiff.taginfos;
 
 import org.apache.commons.imaging.ImageWriteException;
-import org.apache.commons.imaging.common.BinaryConversions;
+import org.apache.commons.imaging.common.ByteConversions;
 import org.apache.commons.imaging.common.ByteOrder;
 import org.apache.commons.imaging.formats.tiff.constants.TiffDirectoryType;
 
@@ -27,10 +27,10 @@ public class TagInfoFloat extends TagInf
     }
     
     public float[] getValue(final ByteOrder byteOrder, final byte[] bytes) {
-        return BinaryConversions.toFloats(bytes, byteOrder);
+        return ByteConversions.toFloats(bytes, byteOrder);
     }
     
     public byte[] encodeValue(final ByteOrder byteOrder, final float... values) throws ImageWriteException {
-        return BinaryConversions.toBytes(values, byteOrder);
+        return ByteConversions.toBytes(values, byteOrder);
     }
 }

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoLong.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoLong.java?rev=1441735&r1=1441734&r2=1441735&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoLong.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoLong.java Sat Feb  2 11:48:07 2013
@@ -16,7 +16,7 @@
  */
 package org.apache.commons.imaging.formats.tiff.taginfos;
 
-import org.apache.commons.imaging.common.BinaryConversions;
+import org.apache.commons.imaging.common.ByteConversions;
 import org.apache.commons.imaging.common.ByteOrder;
 import org.apache.commons.imaging.formats.tiff.constants.TiffDirectoryType;
 
@@ -31,10 +31,10 @@ public class TagInfoLong extends TagInfo
     }
     
     public int[] getValue(final ByteOrder byteOrder, final byte[] bytes) {
-        return BinaryConversions.toInts(bytes, byteOrder);
+        return ByteConversions.toInts(bytes, byteOrder);
     }
     
     public byte[] encodeValue(final ByteOrder byteOrder, final int... values) {
-        return BinaryConversions.toBytes(values, byteOrder);
+        return ByteConversions.toBytes(values, byteOrder);
     }
 }

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoRational.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoRational.java?rev=1441735&r1=1441734&r2=1441735&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoRational.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoRational.java Sat Feb  2 11:48:07 2013
@@ -16,7 +16,7 @@
  */
 package org.apache.commons.imaging.formats.tiff.taginfos;
 
-import org.apache.commons.imaging.common.BinaryConversions;
+import org.apache.commons.imaging.common.ByteConversions;
 import org.apache.commons.imaging.common.ByteOrder;
 import org.apache.commons.imaging.common.RationalNumber;
 import org.apache.commons.imaging.formats.tiff.constants.TiffDirectoryType;
@@ -27,10 +27,10 @@ public class TagInfoRational extends Tag
     }
 
     public RationalNumber[] getValue(final ByteOrder byteOrder, final byte[] bytes) {
-        return BinaryConversions.toRationals(bytes, byteOrder);
+        return ByteConversions.toRationals(bytes, byteOrder);
     }
     
     public byte[] encodeValue(final ByteOrder byteOrder, final RationalNumber... values) {
-        return BinaryConversions.toBytes(values, byteOrder);
+        return ByteConversions.toBytes(values, byteOrder);
     }
 }

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoSLong.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoSLong.java?rev=1441735&r1=1441734&r2=1441735&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoSLong.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoSLong.java Sat Feb  2 11:48:07 2013
@@ -17,7 +17,7 @@
 package org.apache.commons.imaging.formats.tiff.taginfos;
 
 import org.apache.commons.imaging.ImageWriteException;
-import org.apache.commons.imaging.common.BinaryConversions;
+import org.apache.commons.imaging.common.ByteConversions;
 import org.apache.commons.imaging.common.ByteOrder;
 import org.apache.commons.imaging.formats.tiff.constants.TiffDirectoryType;
 
@@ -27,10 +27,10 @@ public class TagInfoSLong extends TagInf
     }
     
     public int[] getValue(final ByteOrder byteOrder, final byte[] bytes) {
-        return BinaryConversions.toInts(bytes, byteOrder);
+        return ByteConversions.toInts(bytes, byteOrder);
     }
     
     public byte[] encodeValue(final ByteOrder byteOrder, final int... values) throws ImageWriteException {
-        return BinaryConversions.toBytes(values, byteOrder);
+        return ByteConversions.toBytes(values, byteOrder);
     }
 }

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoSRational.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoSRational.java?rev=1441735&r1=1441734&r2=1441735&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoSRational.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoSRational.java Sat Feb  2 11:48:07 2013
@@ -16,7 +16,7 @@
  */
 package org.apache.commons.imaging.formats.tiff.taginfos;
 
-import org.apache.commons.imaging.common.BinaryConversions;
+import org.apache.commons.imaging.common.ByteConversions;
 import org.apache.commons.imaging.common.ByteOrder;
 import org.apache.commons.imaging.common.RationalNumber;
 import org.apache.commons.imaging.formats.tiff.constants.TiffDirectoryType;
@@ -27,10 +27,10 @@ public class TagInfoSRational extends Ta
     }
 
     public RationalNumber[] getValue(final ByteOrder byteOrder, final byte[] bytes) {
-        return BinaryConversions.toRationals(bytes, byteOrder);
+        return ByteConversions.toRationals(bytes, byteOrder);
     }
     
     public byte[] encodeValue(final ByteOrder byteOrder, final RationalNumber... values) {
-        return BinaryConversions.toBytes(values, byteOrder);
+        return ByteConversions.toBytes(values, byteOrder);
     }
 }

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoSShort.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoSShort.java?rev=1441735&r1=1441734&r2=1441735&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoSShort.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoSShort.java Sat Feb  2 11:48:07 2013
@@ -17,7 +17,7 @@
 package org.apache.commons.imaging.formats.tiff.taginfos;
 
 import org.apache.commons.imaging.ImageWriteException;
-import org.apache.commons.imaging.common.BinaryConversions;
+import org.apache.commons.imaging.common.ByteConversions;
 import org.apache.commons.imaging.common.ByteOrder;
 import org.apache.commons.imaging.formats.tiff.constants.TiffDirectoryType;
 
@@ -27,10 +27,10 @@ public class TagInfoSShort extends TagIn
     }
     
     public short[] getValue(final ByteOrder byteOrder, final byte[] bytes) {
-        return BinaryConversions.toShorts(bytes, byteOrder);
+        return ByteConversions.toShorts(bytes, byteOrder);
     }
     
     public byte[] encodeValue(final ByteOrder byteOrder, final short... values) throws ImageWriteException {
-        return BinaryConversions.toBytes(values, byteOrder);
+        return ByteConversions.toBytes(values, byteOrder);
     }
 }

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoShort.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoShort.java?rev=1441735&r1=1441734&r2=1441735&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoShort.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoShort.java Sat Feb  2 11:48:07 2013
@@ -16,7 +16,7 @@
  */
 package org.apache.commons.imaging.formats.tiff.taginfos;
 
-import org.apache.commons.imaging.common.BinaryConversions;
+import org.apache.commons.imaging.common.ByteConversions;
 import org.apache.commons.imaging.common.ByteOrder;
 import org.apache.commons.imaging.formats.tiff.constants.TiffDirectoryType;
 
@@ -26,10 +26,10 @@ public class TagInfoShort extends TagInf
     }
     
     public short[] getValue(final ByteOrder byteOrder, final byte[] bytes) {
-        return BinaryConversions.toShorts(bytes, byteOrder);
+        return ByteConversions.toShorts(bytes, byteOrder);
     }
 
     public byte[] encodeValue(final ByteOrder byteOrder, final short... values) {
-        return BinaryConversions.toBytes(values, byteOrder);
+        return ByteConversions.toBytes(values, byteOrder);
     }
 }

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoShortOrLong.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoShortOrLong.java?rev=1441735&r1=1441734&r2=1441735&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoShortOrLong.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoShortOrLong.java Sat Feb  2 11:48:07 2013
@@ -16,7 +16,7 @@
  */
 package org.apache.commons.imaging.formats.tiff.taginfos;
 
-import org.apache.commons.imaging.common.BinaryConversions;
+import org.apache.commons.imaging.common.ByteConversions;
 import org.apache.commons.imaging.common.ByteOrder;
 import org.apache.commons.imaging.formats.tiff.constants.TiffDirectoryType;
 
@@ -30,10 +30,10 @@ public class TagInfoShortOrLong extends 
     }
     
     public byte[] encodeValue(final ByteOrder byteOrder, final short... values) {
-        return BinaryConversions.toBytes(values, byteOrder);
+        return ByteConversions.toBytes(values, byteOrder);
     }
     
     public byte[] encodeValue(final ByteOrder byteOrder, final int... values) {
-        return BinaryConversions.toBytes(values, byteOrder);
+        return ByteConversions.toBytes(values, byteOrder);
     }
 }

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoShortOrLongOrRational.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoShortOrLongOrRational.java?rev=1441735&r1=1441734&r2=1441735&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoShortOrLongOrRational.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoShortOrLongOrRational.java Sat Feb  2 11:48:07 2013
@@ -16,7 +16,7 @@
  */
 package org.apache.commons.imaging.formats.tiff.taginfos;
 
-import org.apache.commons.imaging.common.BinaryConversions;
+import org.apache.commons.imaging.common.ByteConversions;
 import org.apache.commons.imaging.common.ByteOrder;
 import org.apache.commons.imaging.common.RationalNumber;
 import org.apache.commons.imaging.formats.tiff.constants.TiffDirectoryType;
@@ -27,14 +27,14 @@ public class TagInfoShortOrLongOrRationa
     }
     
     public byte[] encodeValue(final ByteOrder byteOrder, final short... values) {
-        return BinaryConversions.toBytes(values, byteOrder);
+        return ByteConversions.toBytes(values, byteOrder);
     }
     
     public byte[] encodeValue(final ByteOrder byteOrder, final int... values) {
-        return BinaryConversions.toBytes(values, byteOrder);
+        return ByteConversions.toBytes(values, byteOrder);
     }
     
     public byte[] encodeValue(final ByteOrder byteOrder, final RationalNumber... values) {
-        return BinaryConversions.toBytes(values, byteOrder);
+        return ByteConversions.toBytes(values, byteOrder);
     }
 }

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoShortOrRational.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoShortOrRational.java?rev=1441735&r1=1441734&r2=1441735&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoShortOrRational.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoShortOrRational.java Sat Feb  2 11:48:07 2013
@@ -16,7 +16,7 @@
  */
 package org.apache.commons.imaging.formats.tiff.taginfos;
 
-import org.apache.commons.imaging.common.BinaryConversions;
+import org.apache.commons.imaging.common.ByteConversions;
 import org.apache.commons.imaging.common.ByteOrder;
 import org.apache.commons.imaging.common.RationalNumber;
 import org.apache.commons.imaging.formats.tiff.constants.TiffDirectoryType;
@@ -27,10 +27,10 @@ public class TagInfoShortOrRational exte
     }
     
     public byte[] encodeValue(final ByteOrder byteOrder, final short... values) {
-        return BinaryConversions.toBytes(values, byteOrder);
+        return ByteConversions.toBytes(values, byteOrder);
     }
 
     public byte[] encodeValue(final ByteOrder byteOrder, final RationalNumber... values) {
-        return BinaryConversions.toBytes(values, byteOrder);
+        return ByteConversions.toBytes(values, byteOrder);
     }
 }

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/common/BinaryFileFunctionsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/common/BinaryFileFunctionsTest.java?rev=1441735&r1=1441734&r2=1441735&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/common/BinaryFileFunctionsTest.java (original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/common/BinaryFileFunctionsTest.java Sat Feb  2 11:48:07 2013
@@ -19,28 +19,28 @@ import org.apache.commons.imaging.Imagin
 
 public class BinaryFileFunctionsTest extends ImagingTest {
     public void testFloatToByteConversion() {
-        final byte[] bytesLE = BinaryConversions.toBytes(1.0f,
+        final byte[] bytesLE = ByteConversions.toBytes(1.0f,
                 ByteOrder.LITTLE_ENDIAN);
         assertEquals(
-                BinaryConversions.toFloat(bytesLE, ByteOrder.LITTLE_ENDIAN),
+                ByteConversions.toFloat(bytesLE, ByteOrder.LITTLE_ENDIAN),
                 1.0f, 0f);
 
-        final byte[] bytesBE = BinaryConversions.toBytes(1.0f,
+        final byte[] bytesBE = ByteConversions.toBytes(1.0f,
                 ByteOrder.BIG_ENDIAN);
-        assertEquals(BinaryConversions.toFloat(bytesBE, ByteOrder.BIG_ENDIAN),
+        assertEquals(ByteConversions.toFloat(bytesBE, ByteOrder.BIG_ENDIAN),
                 1.0f, 0f);
     }
 
     public void testDoubleToByteConversion() {
-        final byte[] bytesLE = BinaryConversions.toBytes(1.0,
+        final byte[] bytesLE = ByteConversions.toBytes(1.0,
                 ByteOrder.LITTLE_ENDIAN);
         assertEquals(
-                BinaryConversions.toDouble(bytesLE, ByteOrder.LITTLE_ENDIAN),
+                ByteConversions.toDouble(bytesLE, ByteOrder.LITTLE_ENDIAN),
                 1.0, 0);
 
-        final byte[] bytesBE = BinaryConversions.toBytes(1.0,
+        final byte[] bytesBE = ByteConversions.toBytes(1.0,
                 ByteOrder.BIG_ENDIAN);
-        assertEquals(BinaryConversions.toDouble(bytesBE, ByteOrder.BIG_ENDIAN),
+        assertEquals(ByteConversions.toDouble(bytesBE, ByteOrder.BIG_ENDIAN),
                 1.0, 0);
     }
 }



Mime
View raw message