Index: C:/harmony/trunk_0427/modules/nio/src/main/java/java/nio/ReadWriteDirectByteBuffer.java =================================================================== --- C:/harmony/trunk_0427/modules/nio/src/main/java/java/nio/ReadWriteDirectByteBuffer.java (revision 419772) +++ C:/harmony/trunk_0427/modules/nio/src/main/java/java/nio/ReadWriteDirectByteBuffer.java (working copy) @@ -101,7 +101,7 @@ * @see java.nio.ByteBuffer#put(byte[], int, int) */ public ByteBuffer put(byte[] src, int off, int len) { - if (off < 0 || len < 0 || off + len > src.length) { + if (off < 0 || len < 0 || (long)off + (long)len > (long)src.length) { throw new IndexOutOfBoundsException(); } if (len > remaining()) { @@ -127,7 +127,7 @@ } public ByteBuffer putDouble(int index, double value) { - if (index < 0 || index + 8 > limit) { + if (index < 0 || (long)index + 8 > (long)limit) { throw new IndexOutOfBoundsException(); } getBaseAddress().setDouble(offset + index, value, order); @@ -145,7 +145,7 @@ } public ByteBuffer putFloat(int index, float value) { - if (index < 0 || index + 4 > limit) { + if (index < 0 || (long)index + 4 > (long)limit) { throw new IndexOutOfBoundsException(); } getBaseAddress().setFloat(offset + index, value, order); @@ -163,7 +163,7 @@ } public ByteBuffer putInt(int index, int value) { - if (index < 0 || index + 4 > limit) { + if (index < 0 || (long)index + 4 > (long)limit) { throw new IndexOutOfBoundsException(); } getBaseAddress().setInt(offset + index, value, order); @@ -181,7 +181,7 @@ } public ByteBuffer putLong(int index, long value) { - if (index < 0 || index + 8 > limit) { + if (index < 0 || (long)index + 8 > (long)limit) { throw new IndexOutOfBoundsException(); } getBaseAddress().setLong(offset + index, value, order); @@ -199,7 +199,7 @@ } public ByteBuffer putShort(int index, short value) { - if (index < 0 || index + 2 > limit) { + if (index < 0 || (long)index + 2 > (long)limit) { throw new IndexOutOfBoundsException(); } getBaseAddress().setShort(offset + index, value, order);