Index: C:/harmony/trunk_0427/modules/nio/src/main/java/java/nio/ReadWriteHeapByteBuffer.java =================================================================== --- C:/harmony/trunk_0427/modules/nio/src/main/java/java/nio/ReadWriteHeapByteBuffer.java (revision 419837) +++ C:/harmony/trunk_0427/modules/nio/src/main/java/java/nio/ReadWriteHeapByteBuffer.java (working copy) @@ -109,7 +109,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()) { @@ -151,7 +151,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(); } store(index, value); @@ -159,7 +159,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(); } store(index, value); @@ -177,7 +177,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(); } store(index, value);