harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r578091 [7/8] - /harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/
Date Fri, 21 Sep 2007 13:06:01 GMT
Modified: harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadOnlyIntArrayBuffer.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadOnlyIntArrayBuffer.java?rev=578091&r1=578090&r2=578091&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadOnlyIntArrayBuffer.java (original)
+++ harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadOnlyIntArrayBuffer.java Fri Sep 21 06:05:59 2007
@@ -31,66 +31,78 @@
  */
 final class ReadOnlyIntArrayBuffer extends IntArrayBuffer {
 
-	static ReadOnlyIntArrayBuffer copy(IntArrayBuffer other, int markOfOther) {
-		ReadOnlyIntArrayBuffer buf = new ReadOnlyIntArrayBuffer(other
-				.capacity(), other.backingArray, other.offset);
-		buf.limit = other.limit();
-		buf.position = other.position();
-		buf.mark = markOfOther;
-		return buf;
-	}
-
-	ReadOnlyIntArrayBuffer(int capacity, int[] backingArray, int arrayOffset) {
-		super(capacity, backingArray, arrayOffset);
-	}
-
-	public IntBuffer asReadOnlyBuffer() {
-		return duplicate();
-	}
-
-	public IntBuffer compact() {
-		throw new ReadOnlyBufferException();
-	}
-
-	public IntBuffer duplicate() {
-		return copy(this, mark);
-	}
-
-	public boolean isReadOnly() {
-		return true;
-	}
-
-	protected int[] protectedArray() {
-		throw new ReadOnlyBufferException();
-	}
-
-	protected int protectedArrayOffset() {
-		throw new ReadOnlyBufferException();
-	}
-
-	protected boolean protectedHasArray() {
-		return false;
-	}
-
-	public IntBuffer put(int c) {
-		throw new ReadOnlyBufferException();
-	}
-
-	public IntBuffer put(int index, int c) {
-		throw new ReadOnlyBufferException();
-	}
-    
+    static ReadOnlyIntArrayBuffer copy(IntArrayBuffer other, int markOfOther) {
+        ReadOnlyIntArrayBuffer buf = new ReadOnlyIntArrayBuffer(other
+                .capacity(), other.backingArray, other.offset);
+        buf.limit = other.limit();
+        buf.position = other.position();
+        buf.mark = markOfOther;
+        return buf;
+    }
+
+    ReadOnlyIntArrayBuffer(int capacity, int[] backingArray, int arrayOffset) {
+        super(capacity, backingArray, arrayOffset);
+    }
+
+    @Override
+    public IntBuffer asReadOnlyBuffer() {
+        return duplicate();
+    }
+
+    @Override
+    public IntBuffer compact() {
+        throw new ReadOnlyBufferException();
+    }
+
+    @Override
+    public IntBuffer duplicate() {
+        return copy(this, mark);
+    }
+
+    @Override
+    public boolean isReadOnly() {
+        return true;
+    }
+
+    @Override
+    protected int[] protectedArray() {
+        throw new ReadOnlyBufferException();
+    }
+
+    @Override
+    protected int protectedArrayOffset() {
+        throw new ReadOnlyBufferException();
+    }
+
+    @Override
+    protected boolean protectedHasArray() {
+        return false;
+    }
+
+    @Override
+    public IntBuffer put(int c) {
+        throw new ReadOnlyBufferException();
+    }
+
+    @Override
+    public IntBuffer put(int index, int c) {
+        throw new ReadOnlyBufferException();
+    }
+
+    @Override
     public IntBuffer put(IntBuffer buf) {
         throw new ReadOnlyBufferException();
     }
 
+    @Override
     public final IntBuffer put(int[] src, int off, int len) {
         throw new ReadOnlyBufferException();
     }
-    
-	public IntBuffer slice() {
-		return new ReadOnlyIntArrayBuffer(remaining(), backingArray, offset
-				+ position);
-	}
+
+    @Override
+    public IntBuffer slice() {
+        return new ReadOnlyIntArrayBuffer(remaining(), backingArray, offset
+                + position);
+    }
 
 }

Modified: harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadOnlyLongArrayBuffer.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadOnlyLongArrayBuffer.java?rev=578091&r1=578090&r2=578091&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadOnlyLongArrayBuffer.java (original)
+++ harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadOnlyLongArrayBuffer.java Fri Sep 21 06:05:59 2007
@@ -31,66 +31,78 @@
  */
 final class ReadOnlyLongArrayBuffer extends LongArrayBuffer {
 
-	static ReadOnlyLongArrayBuffer copy(LongArrayBuffer other, int markOfOther) {
-		ReadOnlyLongArrayBuffer buf = new ReadOnlyLongArrayBuffer(other
-				.capacity(), other.backingArray, other.offset);
-		buf.limit = other.limit();
-		buf.position = other.position();
-		buf.mark = markOfOther;
-		return buf;
-	}
-
-	ReadOnlyLongArrayBuffer(int capacity, long[] backingArray, int arrayOffset) {
-		super(capacity, backingArray, arrayOffset);
-	}
-
-	public LongBuffer asReadOnlyBuffer() {
-		return duplicate();
-	}
-
-	public LongBuffer compact() {
-		throw new ReadOnlyBufferException();
-	}
-
-	public LongBuffer duplicate() {
-		return copy(this, mark);
-	}
-
-	public boolean isReadOnly() {
-		return true;
-	}
-
-	protected long[] protectedArray() {
-		throw new ReadOnlyBufferException();
-	}
-
-	protected int protectedArrayOffset() {
-		throw new ReadOnlyBufferException();
-	}
-
-	protected boolean protectedHasArray() {
-		return false;
-	}
-
-	public LongBuffer put(long c) {
-		throw new ReadOnlyBufferException();
-	}
-
-	public LongBuffer put(int index, long c) {
-		throw new ReadOnlyBufferException();
-	}
-    
+    static ReadOnlyLongArrayBuffer copy(LongArrayBuffer other, int markOfOther) {
+        ReadOnlyLongArrayBuffer buf = new ReadOnlyLongArrayBuffer(other
+                .capacity(), other.backingArray, other.offset);
+        buf.limit = other.limit();
+        buf.position = other.position();
+        buf.mark = markOfOther;
+        return buf;
+    }
+
+    ReadOnlyLongArrayBuffer(int capacity, long[] backingArray, int arrayOffset) {
+        super(capacity, backingArray, arrayOffset);
+    }
+
+    @Override
+    public LongBuffer asReadOnlyBuffer() {
+        return duplicate();
+    }
+
+    @Override
+    public LongBuffer compact() {
+        throw new ReadOnlyBufferException();
+    }
+
+    @Override
+    public LongBuffer duplicate() {
+        return copy(this, mark);
+    }
+
+    @Override
+    public boolean isReadOnly() {
+        return true;
+    }
+
+    @Override
+    protected long[] protectedArray() {
+        throw new ReadOnlyBufferException();
+    }
+
+    @Override
+    protected int protectedArrayOffset() {
+        throw new ReadOnlyBufferException();
+    }
+
+    @Override
+    protected boolean protectedHasArray() {
+        return false;
+    }
+
+    @Override
+    public LongBuffer put(long c) {
+        throw new ReadOnlyBufferException();
+    }
+
+    @Override
+    public LongBuffer put(int index, long c) {
+        throw new ReadOnlyBufferException();
+    }
+
+    @Override
     public LongBuffer put(LongBuffer buf) {
         throw new ReadOnlyBufferException();
     }
 
+    @Override
     public final LongBuffer put(long[] src, int off, int len) {
         throw new ReadOnlyBufferException();
     }
-    
-	public LongBuffer slice() {
-		return new ReadOnlyLongArrayBuffer(remaining(), backingArray, offset
-				+ position);
-	}
+
+    @Override
+    public LongBuffer slice() {
+        return new ReadOnlyLongArrayBuffer(remaining(), backingArray, offset
+                + position);
+    }
 
 }

Modified: harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadOnlyShortArrayBuffer.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadOnlyShortArrayBuffer.java?rev=578091&r1=578090&r2=578091&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadOnlyShortArrayBuffer.java (original)
+++ harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadOnlyShortArrayBuffer.java Fri Sep 21 06:05:59 2007
@@ -31,66 +31,78 @@
  */
 final class ReadOnlyShortArrayBuffer extends ShortArrayBuffer {
 
-	static ReadOnlyShortArrayBuffer copy(ShortArrayBuffer other, int markOfOther) {
-		ReadOnlyShortArrayBuffer buf = new ReadOnlyShortArrayBuffer(other
-				.capacity(), other.backingArray, other.offset);
-		buf.limit = other.limit();
-		buf.position = other.position();
-		buf.mark = markOfOther;
-		return buf;
-	}
-
-	ReadOnlyShortArrayBuffer(int capacity, short[] backingArray, int arrayOffset) {
-		super(capacity, backingArray, arrayOffset);
-	}
-
-	public ShortBuffer asReadOnlyBuffer() {
-		return duplicate();
-	}
-
-	public ShortBuffer compact() {
-		throw new ReadOnlyBufferException();
-	}
-
-	public ShortBuffer duplicate() {
-		return copy(this, mark);
-	}
-
-	public boolean isReadOnly() {
-		return true;
-	}
-
-	protected short[] protectedArray() {
-		throw new ReadOnlyBufferException();
-	}
-
-	protected int protectedArrayOffset() {
-		throw new ReadOnlyBufferException();
-	}
-
-	protected boolean protectedHasArray() {
-		return false;
-	}
-    
+    static ReadOnlyShortArrayBuffer copy(ShortArrayBuffer other, int markOfOther) {
+        ReadOnlyShortArrayBuffer buf = new ReadOnlyShortArrayBuffer(other
+                .capacity(), other.backingArray, other.offset);
+        buf.limit = other.limit();
+        buf.position = other.position();
+        buf.mark = markOfOther;
+        return buf;
+    }
+
+    ReadOnlyShortArrayBuffer(int capacity, short[] backingArray, int arrayOffset) {
+        super(capacity, backingArray, arrayOffset);
+    }
+
+    @Override
+    public ShortBuffer asReadOnlyBuffer() {
+        return duplicate();
+    }
+
+    @Override
+    public ShortBuffer compact() {
+        throw new ReadOnlyBufferException();
+    }
+
+    @Override
+    public ShortBuffer duplicate() {
+        return copy(this, mark);
+    }
+
+    @Override
+    public boolean isReadOnly() {
+        return true;
+    }
+
+    @Override
+    protected short[] protectedArray() {
+        throw new ReadOnlyBufferException();
+    }
+
+    @Override
+    protected int protectedArrayOffset() {
+        throw new ReadOnlyBufferException();
+    }
+
+    @Override
+    protected boolean protectedHasArray() {
+        return false;
+    }
+
+    @Override
     public ShortBuffer put(ShortBuffer buf) {
         throw new ReadOnlyBufferException();
     }
 
-	public ShortBuffer put(short c) {
-		throw new ReadOnlyBufferException();
-	}
-
-	public ShortBuffer put(int index, short c) {
-		throw new ReadOnlyBufferException();
-	}
+    @Override
+    public ShortBuffer put(short c) {
+        throw new ReadOnlyBufferException();
+    }
 
+    @Override
+    public ShortBuffer put(int index, short c) {
+        throw new ReadOnlyBufferException();
+    }
+
+    @Override
     public final ShortBuffer put(short[] src, int off, int len) {
         throw new ReadOnlyBufferException();
     }
-    
-	public ShortBuffer slice() {
-		return new ReadOnlyShortArrayBuffer(remaining(), backingArray, offset
-				+ position);
-	}
+
+    @Override
+    public ShortBuffer slice() {
+        return new ReadOnlyShortArrayBuffer(remaining(), backingArray, offset
+                + position);
+    }
 
 }

Modified: harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadWriteCharArrayBuffer.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadWriteCharArrayBuffer.java?rev=578091&r1=578090&r2=578091&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadWriteCharArrayBuffer.java (original)
+++ harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadWriteCharArrayBuffer.java Fri Sep 21 06:05:59 2007
@@ -30,92 +30,103 @@
  */
 final class ReadWriteCharArrayBuffer extends CharArrayBuffer {
 
-	static ReadWriteCharArrayBuffer copy(CharArrayBuffer other, int markOfOther) {
-		ReadWriteCharArrayBuffer buf = new ReadWriteCharArrayBuffer(other
-				.capacity(), other.backingArray, other.offset);
-		buf.limit = other.limit();
-		buf.position = other.position();
-		buf.mark = markOfOther;
-		return buf;
-	}
-
-	ReadWriteCharArrayBuffer(char[] array) {
-		super(array);
-	}
-
-	ReadWriteCharArrayBuffer(int capacity) {
-		super(capacity);
-	}
-
-	ReadWriteCharArrayBuffer(int capacity, char[] backingArray, int arrayOffset) {
-		super(capacity, backingArray, arrayOffset);
-	}
-
-	public CharBuffer asReadOnlyBuffer() {
-		return ReadOnlyCharArrayBuffer.copy(this, mark);
-	}
-
-	public CharBuffer compact() {
-		System.arraycopy(backingArray, position + offset, backingArray, offset,
-				remaining());
-		position = limit - position;
-		limit = capacity;
-		mark = UNSET_MARK;
-		return this;
-	}
-
-	public CharBuffer duplicate() {
-		return copy(this, mark);
-	}
-
-	public boolean isReadOnly() {
-		return false;
-	}
-
-	protected char[] protectedArray() {
-		return backingArray;
-	}
-
-	protected int protectedArrayOffset() {
-		return offset;
-	}
-
-	protected boolean protectedHasArray() {
-		return true;
-	}
-
-	public CharBuffer put(char c) {
-		if (position == limit) {
-			throw new BufferOverflowException();
-		}
-		backingArray[offset + position++] = c;
-		return this;
-	}
-
-	public CharBuffer put(int index, char c) {
-		if (index < 0 || index >= limit) {
-			throw new IndexOutOfBoundsException();
-		}
-		backingArray[offset + index] = c;
-		return this;
-	}
+    static ReadWriteCharArrayBuffer copy(CharArrayBuffer other, int markOfOther) {
+        ReadWriteCharArrayBuffer buf = new ReadWriteCharArrayBuffer(other
+                .capacity(), other.backingArray, other.offset);
+        buf.limit = other.limit();
+        buf.position = other.position();
+        buf.mark = markOfOther;
+        return buf;
+    }
+
+    ReadWriteCharArrayBuffer(char[] array) {
+        super(array);
+    }
+
+    ReadWriteCharArrayBuffer(int capacity) {
+        super(capacity);
+    }
+
+    ReadWriteCharArrayBuffer(int capacity, char[] backingArray, int arrayOffset) {
+        super(capacity, backingArray, arrayOffset);
+    }
+
+    @Override
+    public CharBuffer asReadOnlyBuffer() {
+        return ReadOnlyCharArrayBuffer.copy(this, mark);
+    }
+
+    @Override
+    public CharBuffer compact() {
+        System.arraycopy(backingArray, position + offset, backingArray, offset,
+                remaining());
+        position = limit - position;
+        limit = capacity;
+        mark = UNSET_MARK;
+        return this;
+    }
+
+    @Override
+    public CharBuffer duplicate() {
+        return copy(this, mark);
+    }
+
+    @Override
+    public boolean isReadOnly() {
+        return false;
+    }
+
+    @Override
+    protected char[] protectedArray() {
+        return backingArray;
+    }
+
+    @Override
+    protected int protectedArrayOffset() {
+        return offset;
+    }
+
+    @Override
+    protected boolean protectedHasArray() {
+        return true;
+    }
 
+    @Override
+    public CharBuffer put(char c) {
+        if (position == limit) {
+            throw new BufferOverflowException();
+        }
+        backingArray[offset + position++] = c;
+        return this;
+    }
+
+    @Override
+    public CharBuffer put(int index, char c) {
+        if (index < 0 || index >= limit) {
+            throw new IndexOutOfBoundsException();
+        }
+        backingArray[offset + index] = c;
+        return this;
+    }
+
+    @Override
     public CharBuffer put(char[] src, int off, int len) {
         int length = src.length;
-        if (off < 0 || len < 0 || (long)len + (long)off > length) {
+        if (off < 0 || len < 0 || (long) len + (long) off > length) {
             throw new IndexOutOfBoundsException();
         }
         if (len > remaining()) {
             throw new BufferOverflowException();
         }
-        System.arraycopy(src, off, backingArray, offset+position, len);
+        System.arraycopy(src, off, backingArray, offset + position, len);
         position += len;
         return this;
     }
-    
-	public CharBuffer slice() {
-		return new ReadWriteCharArrayBuffer(remaining(), backingArray, offset
-				+ position);
-	}
+
+    @Override
+    public CharBuffer slice() {
+        return new ReadWriteCharArrayBuffer(remaining(), backingArray, offset
+                + position);
+    }
 
 }

Modified: harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadWriteDirectByteBuffer.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadWriteDirectByteBuffer.java?rev=578091&r1=578090&r2=578091&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadWriteDirectByteBuffer.java (original)
+++ harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadWriteDirectByteBuffer.java Fri Sep 21 06:05:59 2007
@@ -33,67 +33,73 @@
  */
 final class ReadWriteDirectByteBuffer extends DirectByteBuffer {
 
-	static ReadWriteDirectByteBuffer copy(DirectByteBuffer other,
-			int markOfOther) {
-		ReadWriteDirectByteBuffer buf = new ReadWriteDirectByteBuffer(
-				other.safeAddress, other.capacity(), other.offset);
-		buf.limit = other.limit();
-		buf.position = other.position();
-		buf.mark = markOfOther;
-		buf.order(other.order());
-		return buf;
-	}
-
-	ReadWriteDirectByteBuffer(int capacity) {
-		super(capacity);
-	}
-
-	ReadWriteDirectByteBuffer(SafeAddress address, int capacity, int offset) {
-		super(address, capacity, offset);
-	}
+    static ReadWriteDirectByteBuffer copy(DirectByteBuffer other,
+            int markOfOther) {
+        ReadWriteDirectByteBuffer buf = new ReadWriteDirectByteBuffer(
+                other.safeAddress, other.capacity(), other.offset);
+        buf.limit = other.limit();
+        buf.position = other.position();
+        buf.mark = markOfOther;
+        buf.order(other.order());
+        return buf;
+    }
+
+    ReadWriteDirectByteBuffer(int capacity) {
+        super(capacity);
+    }
+
+    ReadWriteDirectByteBuffer(SafeAddress address, int capacity, int offset) {
+        super(address, capacity, offset);
+    }
 
     ReadWriteDirectByteBuffer(PlatformAddress address, int aCapacity,
             int anOffset) {
         super(new SafeAddress(address), aCapacity, anOffset);
     }
-    
-	public ByteBuffer asReadOnlyBuffer() {
-		return ReadOnlyDirectByteBuffer.copy(this, mark);
-	}
-
-	public ByteBuffer compact() {
-		PlatformAddress effectiveAddress = getEffectiveAddress();
-		effectiveAddress.offsetBytes(position).moveTo(effectiveAddress,
-				remaining());
-		position = limit - position;
-		limit = capacity;
-		mark = UNSET_MARK;
-		return this;
-	}
-
-	public ByteBuffer duplicate() {
-		return copy(this, mark);
-	}
-
-	public boolean isReadOnly() {
-		return false;
-	}
-
-	public ByteBuffer put(byte value) {
-		if (position == limit) {
-			throw new BufferOverflowException();
-		}
-		getBaseAddress().setByte(offset + position++, value);
-		return this;
-	}
-
-	public ByteBuffer put(int index, byte value) {
-		if (index < 0 || index >= limit) {
-			throw new IndexOutOfBoundsException();
-		}
-		getBaseAddress().setByte(offset + index, value);
-		return this;
-	}
+
+    @Override
+    public ByteBuffer asReadOnlyBuffer() {
+        return ReadOnlyDirectByteBuffer.copy(this, mark);
+    }
+
+    @Override
+    public ByteBuffer compact() {
+        PlatformAddress effectiveAddress = getEffectiveAddress();
+        effectiveAddress.offsetBytes(position).moveTo(effectiveAddress,
+                remaining());
+        position = limit - position;
+        limit = capacity;
+        mark = UNSET_MARK;
+        return this;
+    }
+
+    @Override
+    public ByteBuffer duplicate() {
+        return copy(this, mark);
+    }
+
+    @Override
+    public boolean isReadOnly() {
+        return false;
+    }
+
+    @Override
+    public ByteBuffer put(byte value) {
+        if (position == limit) {
+            throw new BufferOverflowException();
+        }
+        getBaseAddress().setByte(offset + position++, value);
+        return this;
+    }
+
+    @Override
+    public ByteBuffer put(int index, byte value) {
+        if (index < 0 || index >= limit) {
+            throw new IndexOutOfBoundsException();
+        }
+        getBaseAddress().setByte(offset + index, value);
+        return this;
+    }
 
     /*
      * Override ByteBuffer.put(byte[], int, int) to improve performance.
@@ -102,9 +108,10 @@
      * 
      * @see java.nio.ByteBuffer#put(byte[], int, int)
      */
+    @Override
     public ByteBuffer put(byte[] src, int off, int len) {
         int length = src.length;
-        if (off < 0 || len < 0 || (long)off + (long)len > length) {
+        if (off < 0 || len < 0 || (long) off + (long) len > length) {
             throw new IndexOutOfBoundsException();
         }
         if (len > remaining()) {
@@ -113,107 +120,117 @@
         if (isReadOnly()) {
             throw new ReadOnlyBufferException();
         }
-        getBaseAddress().setByteArray(offset + position, src, off,
-                len);
+        getBaseAddress().setByteArray(offset + position, src, off, len);
         position += len;
         return this;
     }
-    
-	public ByteBuffer putDouble(double value) {
-		int newPosition = position + 8;
-		if (newPosition > limit) {
-			throw new BufferOverflowException();
-		}
-		getBaseAddress().setDouble(offset + position, value, order);
-		position = newPosition;
-		return this;
-	}
-
-	public ByteBuffer putDouble(int index, double value) {
-		if (index < 0 || (long)index + 8 > limit) {
-			throw new IndexOutOfBoundsException();
-		}
-		getBaseAddress().setDouble(offset + index, value, order);
-		return this;
-	}
-
-	public ByteBuffer putFloat(float value) {
-		int newPosition = position + 4;
-		if (newPosition > limit) {
-			throw new BufferOverflowException();
-		}
-		getBaseAddress().setFloat(offset + position, value, order);
-		position = newPosition;
-		return this;
-	}
-
-	public ByteBuffer putFloat(int index, float value) {
-		if (index < 0 || (long)index + 4 > limit) {
-			throw new IndexOutOfBoundsException();
-		}
-		getBaseAddress().setFloat(offset + index, value, order);
-		return this;
-	}
-
-	public ByteBuffer putInt(int value) {
-		int newPosition = position + 4;
-		if (newPosition > limit) {
-			throw new BufferOverflowException();
-		}
-		getBaseAddress().setInt(offset + position, value, order);
-		position = newPosition;
-		return this;
-	}
-
-	public ByteBuffer putInt(int index, int value) {
-		if (index < 0 || (long)index + 4 > limit) {
-			throw new IndexOutOfBoundsException();
-		}
-		getBaseAddress().setInt(offset + index, value, order);
-		return this;
-	}
-
-	public ByteBuffer putLong(long value) {
-		int newPosition = position + 8;
-		if (newPosition > limit) {
-			throw new BufferOverflowException();
-		}
-		getBaseAddress().setLong(offset + position, value, order);
-		position = newPosition;
-		return this;
-	}
-
-	public ByteBuffer putLong(int index, long value) {
-		if (index < 0 || (long)index + 8 > limit) {
-			throw new IndexOutOfBoundsException();
-		}
-		getBaseAddress().setLong(offset + index, value, order);
-		return this;
-	}
-
-	public ByteBuffer putShort(short value) {
-		int newPosition = position + 2;
-		if (newPosition > limit) {
-			throw new BufferOverflowException();
-		}
-		getBaseAddress().setShort(offset + position, value, order);
-		position = newPosition;
-		return this;
-	}
-
-	public ByteBuffer putShort(int index, short value) {
-		if (index < 0 || (long)index + 2 > limit) {
-			throw new IndexOutOfBoundsException();
-		}
-		getBaseAddress().setShort(offset + index, value, order);
-		return this;
-	}
-
-	public ByteBuffer slice() {
-		ReadWriteDirectByteBuffer buf = new ReadWriteDirectByteBuffer(
-				safeAddress, remaining(), offset + position);
-		buf.order = order;
-		return buf;
-	}
+
+    @Override
+    public ByteBuffer putDouble(double value) {
+        int newPosition = position + 8;
+        if (newPosition > limit) {
+            throw new BufferOverflowException();
+        }
+        getBaseAddress().setDouble(offset + position, value, order);
+        position = newPosition;
+        return this;
+    }
+
+    @Override
+    public ByteBuffer putDouble(int index, double value) {
+        if (index < 0 || (long) index + 8 > limit) {
+            throw new IndexOutOfBoundsException();
+        }
+        getBaseAddress().setDouble(offset + index, value, order);
+        return this;
+    }
+
+    @Override
+    public ByteBuffer putFloat(float value) {
+        int newPosition = position + 4;
+        if (newPosition > limit) {
+            throw new BufferOverflowException();
+        }
+        getBaseAddress().setFloat(offset + position, value, order);
+        position = newPosition;
+        return this;
+    }
+
+    @Override
+    public ByteBuffer putFloat(int index, float value) {
+        if (index < 0 || (long) index + 4 > limit) {
+            throw new IndexOutOfBoundsException();
+        }
+        getBaseAddress().setFloat(offset + index, value, order);
+        return this;
+    }
+
+    @Override
+    public ByteBuffer putInt(int value) {
+        int newPosition = position + 4;
+        if (newPosition > limit) {
+            throw new BufferOverflowException();
+        }
+        getBaseAddress().setInt(offset + position, value, order);
+        position = newPosition;
+        return this;
+    }
+
+    @Override
+    public ByteBuffer putInt(int index, int value) {
+        if (index < 0 || (long) index + 4 > limit) {
+            throw new IndexOutOfBoundsException();
+        }
+        getBaseAddress().setInt(offset + index, value, order);
+        return this;
+    }
+
+    @Override
+    public ByteBuffer putLong(long value) {
+        int newPosition = position + 8;
+        if (newPosition > limit) {
+            throw new BufferOverflowException();
+        }
+        getBaseAddress().setLong(offset + position, value, order);
+        position = newPosition;
+        return this;
+    }
+
+    @Override
+    public ByteBuffer putLong(int index, long value) {
+        if (index < 0 || (long) index + 8 > limit) {
+            throw new IndexOutOfBoundsException();
+        }
+        getBaseAddress().setLong(offset + index, value, order);
+        return this;
+    }
+
+    @Override
+    public ByteBuffer putShort(short value) {
+        int newPosition = position + 2;
+        if (newPosition > limit) {
+            throw new BufferOverflowException();
+        }
+        getBaseAddress().setShort(offset + position, value, order);
+        position = newPosition;
+        return this;
+    }
+
+    @Override
+    public ByteBuffer putShort(int index, short value) {
+        if (index < 0 || (long) index + 2 > limit) {
+            throw new IndexOutOfBoundsException();
+        }
+        getBaseAddress().setShort(offset + index, value, order);
+        return this;
+    }
+
+    @Override
+    public ByteBuffer slice() {
+        ReadWriteDirectByteBuffer buf = new ReadWriteDirectByteBuffer(
+                safeAddress, remaining(), offset + position);
+        buf.order = order;
+        return buf;
+    }
 
 }

Modified: harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadWriteDoubleArrayBuffer.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadWriteDoubleArrayBuffer.java?rev=578091&r1=578090&r2=578091&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadWriteDoubleArrayBuffer.java (original)
+++ harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadWriteDoubleArrayBuffer.java Fri Sep 21 06:05:59 2007
@@ -31,95 +31,105 @@
  */
 final class ReadWriteDoubleArrayBuffer extends DoubleArrayBuffer {
 
-	static ReadWriteDoubleArrayBuffer copy(DoubleArrayBuffer other,
-			int markOfOther) {
-		ReadWriteDoubleArrayBuffer buf = new ReadWriteDoubleArrayBuffer(other
-				.capacity(), other.backingArray, other.offset);
-		buf.limit = other.limit();
-		buf.position = other.position();
-		buf.mark = markOfOther;
-		return buf;
-	}
-
-	ReadWriteDoubleArrayBuffer(double[] array) {
-		super(array);
-	}
-
-	ReadWriteDoubleArrayBuffer(int capacity) {
-		super(capacity);
-	}
-
-	ReadWriteDoubleArrayBuffer(int capacity, double[] backingArray,
-			int arrayOffset) {
-		super(capacity, backingArray, arrayOffset);
-	}
-
-	public DoubleBuffer asReadOnlyBuffer() {
-		return ReadOnlyDoubleArrayBuffer.copy(this, mark);
-	}
-
-	public DoubleBuffer compact() {
-		System.arraycopy(backingArray, position + offset, backingArray, offset,
-				remaining());
-		position = limit - position;
-		limit = capacity;
-		mark = UNSET_MARK;
-		return this;
-	}
-
-	public DoubleBuffer duplicate() {
-		return copy(this, mark);
-	}
-
-	public boolean isReadOnly() {
-		return false;
-	}
-
-	protected double[] protectedArray() {
-		return backingArray;
-	}
-
-	protected int protectedArrayOffset() {
-		return offset;
-	}
-
-	protected boolean protectedHasArray() {
-		return true;
-	}
-
-	public DoubleBuffer put(double c) {
-		if (position == limit) {
-			throw new BufferOverflowException();
-		}
-		backingArray[offset + position++] = c;
-		return this;
-	}
-
-	public DoubleBuffer put(int index, double c) {
-		if (index < 0 || index >= limit) {
-			throw new IndexOutOfBoundsException();
-		}
-		backingArray[offset + index] = c;
-		return this;
-	}
+    static ReadWriteDoubleArrayBuffer copy(DoubleArrayBuffer other,
+            int markOfOther) {
+        ReadWriteDoubleArrayBuffer buf = new ReadWriteDoubleArrayBuffer(other
+                .capacity(), other.backingArray, other.offset);
+        buf.limit = other.limit();
+        buf.position = other.position();
+        buf.mark = markOfOther;
+        return buf;
+    }
+
+    ReadWriteDoubleArrayBuffer(double[] array) {
+        super(array);
+    }
+
+    ReadWriteDoubleArrayBuffer(int capacity) {
+        super(capacity);
+    }
+
+    ReadWriteDoubleArrayBuffer(int capacity, double[] backingArray,
+            int arrayOffset) {
+        super(capacity, backingArray, arrayOffset);
+    }
+
+    @Override
+    public DoubleBuffer asReadOnlyBuffer() {
+        return ReadOnlyDoubleArrayBuffer.copy(this, mark);
+    }
+
+    @Override
+    public DoubleBuffer compact() {
+        System.arraycopy(backingArray, position + offset, backingArray, offset,
+                remaining());
+        position = limit - position;
+        limit = capacity;
+        mark = UNSET_MARK;
+        return this;
+    }
+
+    @Override
+    public DoubleBuffer duplicate() {
+        return copy(this, mark);
+    }
+
+    @Override
+    public boolean isReadOnly() {
+        return false;
+    }
+
+    @Override
+    protected double[] protectedArray() {
+        return backingArray;
+    }
+
+    @Override
+    protected int protectedArrayOffset() {
+        return offset;
+    }
+
+    @Override
+    protected boolean protectedHasArray() {
+        return true;
+    }
 
+    @Override
+    public DoubleBuffer put(double c) {
+        if (position == limit) {
+            throw new BufferOverflowException();
+        }
+        backingArray[offset + position++] = c;
+        return this;
+    }
+
+    @Override
+    public DoubleBuffer put(int index, double c) {
+        if (index < 0 || index >= limit) {
+            throw new IndexOutOfBoundsException();
+        }
+        backingArray[offset + index] = c;
+        return this;
+    }
+
+    @Override
     public DoubleBuffer put(double[] src, int off, int len) {
         int length = src.length;
-        if (off < 0 || len < 0 || (long)off + (long)len > length) {
-			throw new IndexOutOfBoundsException();
-		}
+        if (off < 0 || len < 0 || (long) off + (long) len > length) {
+            throw new IndexOutOfBoundsException();
+        }
         if (len > remaining()) {
             throw new BufferOverflowException();
         }
-        System.arraycopy(src, off, backingArray, offset
-                + position, len);
+        System.arraycopy(src, off, backingArray, offset + position, len);
         position += len;
         return this;
     }
-    
-	public DoubleBuffer slice() {
-		return new ReadWriteDoubleArrayBuffer(remaining(), backingArray, offset
-				+ position);
-	}
+
+    @Override
+    public DoubleBuffer slice() {
+        return new ReadWriteDoubleArrayBuffer(remaining(), backingArray, offset
+                + position);
+    }
 
 }

Modified: harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadWriteFloatArrayBuffer.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadWriteFloatArrayBuffer.java?rev=578091&r1=578090&r2=578091&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadWriteFloatArrayBuffer.java (original)
+++ harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadWriteFloatArrayBuffer.java Fri Sep 21 06:05:59 2007
@@ -31,95 +31,105 @@
  */
 final class ReadWriteFloatArrayBuffer extends FloatArrayBuffer {
 
-	static ReadWriteFloatArrayBuffer copy(FloatArrayBuffer other,
-			int markOfOther) {
-		ReadWriteFloatArrayBuffer buf = new ReadWriteFloatArrayBuffer(other
-				.capacity(), other.backingArray, other.offset);
-		buf.limit = other.limit();
-		buf.position = other.position();
-		buf.mark = markOfOther;
-		return buf;
-	}
-
-	ReadWriteFloatArrayBuffer(float[] array) {
-		super(array);
-	}
-
-	ReadWriteFloatArrayBuffer(int capacity) {
-		super(capacity);
-	}
-
-	ReadWriteFloatArrayBuffer(int capacity, float[] backingArray,
-			int arrayOffset) {
-		super(capacity, backingArray, arrayOffset);
-	}
-
-	public FloatBuffer asReadOnlyBuffer() {
-		return ReadOnlyFloatArrayBuffer.copy(this, mark);
-	}
-
-	public FloatBuffer compact() {
-		System.arraycopy(backingArray, position + offset, backingArray, offset,
-				remaining());
-		position = limit - position;
-		limit = capacity;
-		mark = UNSET_MARK;
-		return this;
-	}
-
-	public FloatBuffer duplicate() {
-		return copy(this, mark);
-	}
-
-	public boolean isReadOnly() {
-		return false;
-	}
-
-	protected float[] protectedArray() {
-		return backingArray;
-	}
-
-	protected int protectedArrayOffset() {
-		return offset;
-	}
-
-	protected boolean protectedHasArray() {
-		return true;
-	}
-
-	public FloatBuffer put(float c) {
-		if (position == limit) {
-			throw new BufferOverflowException();
-		}
-		backingArray[offset + position++] = c;
-		return this;
-	}
-
-	public FloatBuffer put(int index, float c) {
-		if (index < 0 || index >= limit) {
-			throw new IndexOutOfBoundsException();
-		}
-		backingArray[offset + index] = c;
-		return this;
-	}
+    static ReadWriteFloatArrayBuffer copy(FloatArrayBuffer other,
+            int markOfOther) {
+        ReadWriteFloatArrayBuffer buf = new ReadWriteFloatArrayBuffer(other
+                .capacity(), other.backingArray, other.offset);
+        buf.limit = other.limit();
+        buf.position = other.position();
+        buf.mark = markOfOther;
+        return buf;
+    }
+
+    ReadWriteFloatArrayBuffer(float[] array) {
+        super(array);
+    }
+
+    ReadWriteFloatArrayBuffer(int capacity) {
+        super(capacity);
+    }
+
+    ReadWriteFloatArrayBuffer(int capacity, float[] backingArray,
+            int arrayOffset) {
+        super(capacity, backingArray, arrayOffset);
+    }
+
+    @Override
+    public FloatBuffer asReadOnlyBuffer() {
+        return ReadOnlyFloatArrayBuffer.copy(this, mark);
+    }
+
+    @Override
+    public FloatBuffer compact() {
+        System.arraycopy(backingArray, position + offset, backingArray, offset,
+                remaining());
+        position = limit - position;
+        limit = capacity;
+        mark = UNSET_MARK;
+        return this;
+    }
+
+    @Override
+    public FloatBuffer duplicate() {
+        return copy(this, mark);
+    }
+
+    @Override
+    public boolean isReadOnly() {
+        return false;
+    }
+
+    @Override
+    protected float[] protectedArray() {
+        return backingArray;
+    }
+
+    @Override
+    protected int protectedArrayOffset() {
+        return offset;
+    }
+
+    @Override
+    protected boolean protectedHasArray() {
+        return true;
+    }
 
+    @Override
+    public FloatBuffer put(float c) {
+        if (position == limit) {
+            throw new BufferOverflowException();
+        }
+        backingArray[offset + position++] = c;
+        return this;
+    }
+
+    @Override
+    public FloatBuffer put(int index, float c) {
+        if (index < 0 || index >= limit) {
+            throw new IndexOutOfBoundsException();
+        }
+        backingArray[offset + index] = c;
+        return this;
+    }
+
+    @Override
     public FloatBuffer put(float[] src, int off, int len) {
         int length = src.length;
-        if (off < 0 || len < 0 || (long)off + (long)len > length) {
+        if (off < 0 || len < 0 || (long) off + (long) len > length) {
             throw new IndexOutOfBoundsException();
         }
         if (len > remaining()) {
             throw new BufferOverflowException();
         }
-        System.arraycopy(src, off, backingArray, offset
-                + position, len);
+        System.arraycopy(src, off, backingArray, offset + position, len);
         position += len;
         return this;
     }
-    
-	public FloatBuffer slice() {
-		return new ReadWriteFloatArrayBuffer(remaining(), backingArray, offset
-				+ position);
-	}
+
+    @Override
+    public FloatBuffer slice() {
+        return new ReadWriteFloatArrayBuffer(remaining(), backingArray, offset
+                + position);
+    }
 
 }

Modified: harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadWriteHeapByteBuffer.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadWriteHeapByteBuffer.java?rev=578091&r1=578090&r2=578091&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadWriteHeapByteBuffer.java (original)
+++ harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadWriteHeapByteBuffer.java Fri Sep 21 06:05:59 2007
@@ -16,8 +16,6 @@
 
 package java.nio;
 
-
-
 /**
  * HeapByteBuffer, ReadWriteHeapByteBuffer and ReadOnlyHeapByteBuffer compose
  * the implementation of array based byte buffers.
@@ -31,76 +29,85 @@
  */
 final class ReadWriteHeapByteBuffer extends HeapByteBuffer {
 
-	static ReadWriteHeapByteBuffer copy(HeapByteBuffer other, int markOfOther) {
-		ReadWriteHeapByteBuffer buf = new ReadWriteHeapByteBuffer(
-				other.backingArray, other.capacity(), other.offset);
-		buf.limit = other.limit();
-		buf.position = other.position();
-		buf.mark = markOfOther;
-		buf.order(other.order());
-		return buf;
-	}
-
-	ReadWriteHeapByteBuffer(byte[] backingArray) {
-		super(backingArray);
-	}
-
-	ReadWriteHeapByteBuffer(int capacity) {
-		super(capacity);
-	}
-
-	ReadWriteHeapByteBuffer(byte[] backingArray, int capacity, int arrayOffset) {
-		super(backingArray, capacity, arrayOffset);
-	}
-
-	public ByteBuffer asReadOnlyBuffer() {
-		return ReadOnlyHeapByteBuffer.copy(this, mark);
-	}
-
-	public ByteBuffer compact() {
-		System.arraycopy(backingArray, position + offset, backingArray, offset,
-				remaining());
-		position = limit - position;
-		limit = capacity;
-		mark = UNSET_MARK;
-		return this;
-	}
-
-	public ByteBuffer duplicate() {
-		return copy(this, mark);
-	}
-
-	public boolean isReadOnly() {
-		return false;
-	}
-
-	protected byte[] protectedArray() {
-		return backingArray;
-	}
-
-	protected int protectedArrayOffset() {
-		return offset;
-	}
-
-	protected boolean protectedHasArray() {
-		return true;
-	}
-
-	public ByteBuffer put(byte b) {
-		if (position == limit) {
-			throw new BufferOverflowException();
-		}
-		backingArray[offset + position++] = b;
-		return this;
-	}
-
-	public ByteBuffer put(int index, byte b) {
-		if (index < 0 || index >= limit) {
-			throw new IndexOutOfBoundsException();
-		}
-		backingArray[offset + index] = b;
-		return this;
-	}
+    static ReadWriteHeapByteBuffer copy(HeapByteBuffer other, int markOfOther) {
+        ReadWriteHeapByteBuffer buf = new ReadWriteHeapByteBuffer(
+                other.backingArray, other.capacity(), other.offset);
+        buf.limit = other.limit();
+        buf.position = other.position();
+        buf.mark = markOfOther;
+        buf.order(other.order());
+        return buf;
+    }
+
+    ReadWriteHeapByteBuffer(byte[] backingArray) {
+        super(backingArray);
+    }
+
+    ReadWriteHeapByteBuffer(int capacity) {
+        super(capacity);
+    }
+
+    ReadWriteHeapByteBuffer(byte[] backingArray, int capacity, int arrayOffset) {
+        super(backingArray, capacity, arrayOffset);
+    }
+
+    @Override
+    public ByteBuffer asReadOnlyBuffer() {
+        return ReadOnlyHeapByteBuffer.copy(this, mark);
+    }
+
+    @Override
+    public ByteBuffer compact() {
+        System.arraycopy(backingArray, position + offset, backingArray, offset,
+                remaining());
+        position = limit - position;
+        limit = capacity;
+        mark = UNSET_MARK;
+        return this;
+    }
+
+    @Override
+    public ByteBuffer duplicate() {
+        return copy(this, mark);
+    }
+
+    @Override
+    public boolean isReadOnly() {
+        return false;
+    }
+
+    @Override
+    protected byte[] protectedArray() {
+        return backingArray;
+    }
+
+    @Override
+    protected int protectedArrayOffset() {
+        return offset;
+    }
+
+    @Override
+    protected boolean protectedHasArray() {
+        return true;
+    }
+
+    @Override
+    public ByteBuffer put(byte b) {
+        if (position == limit) {
+            throw new BufferOverflowException();
+        }
+        backingArray[offset + position++] = b;
+        return this;
+    }
+
+    @Override
+    public ByteBuffer put(int index, byte b) {
+        if (index < 0 || index >= limit) {
+            throw new IndexOutOfBoundsException();
+        }
+        backingArray[offset + index] = b;
+        return this;
+    }
 
     /*
      * Override ByteBuffer.put(byte[], int, int) to improve performance.
@@ -109,8 +116,9 @@
      * 
      * @see java.nio.ByteBuffer#put(byte[], int, int)
      */
+    @Override
     public ByteBuffer put(byte[] src, int off, int len) {
-        if (off < 0 || len < 0 || (long)off + (long)len > src.length) {
+        if (off < 0 || len < 0 || (long) off + (long) len > src.length) {
             throw new IndexOutOfBoundsException();
         }
         if (len > remaining()) {
@@ -119,86 +127,96 @@
         if (isReadOnly()) {
             throw new ReadOnlyBufferException();
         }
-        System.arraycopy(src, off, backingArray, offset
-                + position, len);
+        System.arraycopy(src, off, backingArray, offset + position, len);
         position += len;
         return this;
     }
-    
-	public ByteBuffer putDouble(double value) {
-		return putLong(Double.doubleToRawLongBits(value));
-	}
-
-	public ByteBuffer putDouble(int index, double value) {
-		return putLong(index, Double.doubleToRawLongBits(value));
-	}
-
-	public ByteBuffer putFloat(float value) {
-		return putInt(Float.floatToIntBits(value));
-	}
-
-	public ByteBuffer putFloat(int index, float value) {
-		return putInt(index, Float.floatToIntBits(value));
-	}
-
-	public ByteBuffer putInt(int value) {
-		int newPosition = position + 4;
-		if (newPosition > limit) {
-			throw new BufferOverflowException();
-		}
-		store(position, value);
-		position = newPosition;
-		return this;
-	}
-
-	public ByteBuffer putInt(int index, int value) {
-		if (index < 0 || (long)index + 4 > limit) {
-			throw new IndexOutOfBoundsException();
-		}
-		store(index, value);
-		return this;
-	}
-
-	public ByteBuffer putLong(int index, long value) {
-		if (index < 0 || (long)index + 8 > limit) {
-			throw new IndexOutOfBoundsException();
-		}
-		store(index, value);
-		return this;
-	}
-
-	public ByteBuffer putLong(long value) {
-		int newPosition = position + 8;
-		if (newPosition > limit) {
-			throw new BufferOverflowException();
-		}
-		store(position, value);
-		position = newPosition;
-		return this;
-	}
-
-	public ByteBuffer putShort(int index, short value) {
-		if (index < 0 || (long)index + 2 > limit) {
-			throw new IndexOutOfBoundsException();
-		}
-		store(index, value);
-		return this;
-	}
-
-	public ByteBuffer putShort(short value) {
-		int newPosition = position + 2;
-		if (newPosition > limit) {
-			throw new BufferOverflowException();
-		}
-		store(position, value);
-		position = newPosition;
-		return this;
-	}
-
-	public ByteBuffer slice() {
-		ReadWriteHeapByteBuffer slice = new ReadWriteHeapByteBuffer(
-				backingArray, remaining(), offset + position);
-		slice.order = order;
-		return slice;
-	}
+
+    @Override
+    public ByteBuffer putDouble(double value) {
+        return putLong(Double.doubleToRawLongBits(value));
+    }
+
+    @Override
+    public ByteBuffer putDouble(int index, double value) {
+        return putLong(index, Double.doubleToRawLongBits(value));
+    }
+
+    @Override
+    public ByteBuffer putFloat(float value) {
+        return putInt(Float.floatToIntBits(value));
+    }
+
+    @Override
+    public ByteBuffer putFloat(int index, float value) {
+        return putInt(index, Float.floatToIntBits(value));
+    }
+
+    @Override
+    public ByteBuffer putInt(int value) {
+        int newPosition = position + 4;
+        if (newPosition > limit) {
+            throw new BufferOverflowException();
+        }
+        store(position, value);
+        position = newPosition;
+        return this;
+    }
+
+    @Override
+    public ByteBuffer putInt(int index, int value) {
+        if (index < 0 || (long) index + 4 > limit) {
+            throw new IndexOutOfBoundsException();
+        }
+        store(index, value);
+        return this;
+    }
+
+    @Override
+    public ByteBuffer putLong(int index, long value) {
+        if (index < 0 || (long) index + 8 > limit) {
+            throw new IndexOutOfBoundsException();
+        }
+        store(index, value);
+        return this;
+    }
+
+    @Override
+    public ByteBuffer putLong(long value) {
+        int newPosition = position + 8;
+        if (newPosition > limit) {
+            throw new BufferOverflowException();
+        }
+        store(position, value);
+        position = newPosition;
+        return this;
+    }
+
+    @Override
+    public ByteBuffer putShort(int index, short value) {
+        if (index < 0 || (long) index + 2 > limit) {
+            throw new IndexOutOfBoundsException();
+        }
+        store(index, value);
+        return this;
+    }
+
+    @Override
+    public ByteBuffer putShort(short value) {
+        int newPosition = position + 2;
+        if (newPosition > limit) {
+            throw new BufferOverflowException();
+        }
+        store(position, value);
+        position = newPosition;
+        return this;
+    }
+
+    @Override
+    public ByteBuffer slice() {
+        ReadWriteHeapByteBuffer slice = new ReadWriteHeapByteBuffer(
+                backingArray, remaining(), offset + position);
+        slice.order = order;
+        return slice;
+    }
 }

Modified: harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadWriteIntArrayBuffer.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadWriteIntArrayBuffer.java?rev=578091&r1=578090&r2=578091&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadWriteIntArrayBuffer.java (original)
+++ harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadWriteIntArrayBuffer.java Fri Sep 21 06:05:59 2007
@@ -30,93 +30,103 @@
  */
 final class ReadWriteIntArrayBuffer extends IntArrayBuffer {
 
-	static ReadWriteIntArrayBuffer copy(IntArrayBuffer other, int markOfOther) {
-		ReadWriteIntArrayBuffer buf = new ReadWriteIntArrayBuffer(other
-				.capacity(), other.backingArray, other.offset);
-		buf.limit = other.limit();
-		buf.position = other.position();
-		buf.mark = markOfOther;
-		return buf;
-	}
-
-	ReadWriteIntArrayBuffer(int[] array) {
-		super(array);
-	}
-
-	ReadWriteIntArrayBuffer(int capacity) {
-		super(capacity);
-	}
-
-	ReadWriteIntArrayBuffer(int capacity, int[] backingArray, int arrayOffset) {
-		super(capacity, backingArray, arrayOffset);
-	}
-
-	public IntBuffer asReadOnlyBuffer() {
-		return ReadOnlyIntArrayBuffer.copy(this, mark);
-	}
-
-	public IntBuffer compact() {
-		System.arraycopy(backingArray, position + offset, backingArray, offset,
-				remaining());
-		position = limit - position;
-		limit = capacity;
-		mark = UNSET_MARK;
-		return this;
-	}
-
-	public IntBuffer duplicate() {
-		return copy(this, mark);
-	}
-
-	public boolean isReadOnly() {
-		return false;
-	}
-
-	protected int[] protectedArray() {
-		return backingArray;
-	}
-
-	protected int protectedArrayOffset() {
-		return offset;
-	}
-
-	protected boolean protectedHasArray() {
-		return true;
-	}
-
-	public IntBuffer put(int c) {
-		if (position == limit) {
-			throw new BufferOverflowException();
-		}
-		backingArray[offset + position++] = c;
-		return this;
-	}
-
-	public IntBuffer put(int index, int c) {
-		if (index < 0 || index >= limit) {
-			throw new IndexOutOfBoundsException();
-		}
-		backingArray[offset + index] = c;
-		return this;
-	}
+    static ReadWriteIntArrayBuffer copy(IntArrayBuffer other, int markOfOther) {
+        ReadWriteIntArrayBuffer buf = new ReadWriteIntArrayBuffer(other
+                .capacity(), other.backingArray, other.offset);
+        buf.limit = other.limit();
+        buf.position = other.position();
+        buf.mark = markOfOther;
+        return buf;
+    }
+
+    ReadWriteIntArrayBuffer(int[] array) {
+        super(array);
+    }
+
+    ReadWriteIntArrayBuffer(int capacity) {
+        super(capacity);
+    }
+
+    ReadWriteIntArrayBuffer(int capacity, int[] backingArray, int arrayOffset) {
+        super(capacity, backingArray, arrayOffset);
+    }
+
+    @Override
+    public IntBuffer asReadOnlyBuffer() {
+        return ReadOnlyIntArrayBuffer.copy(this, mark);
+    }
+
+    @Override
+    public IntBuffer compact() {
+        System.arraycopy(backingArray, position + offset, backingArray, offset,
+                remaining());
+        position = limit - position;
+        limit = capacity;
+        mark = UNSET_MARK;
+        return this;
+    }
+
+    @Override
+    public IntBuffer duplicate() {
+        return copy(this, mark);
+    }
+
+    @Override
+    public boolean isReadOnly() {
+        return false;
+    }
+
+    @Override
+    protected int[] protectedArray() {
+        return backingArray;
+    }
+
+    @Override
+    protected int protectedArrayOffset() {
+        return offset;
+    }
+
+    @Override
+    protected boolean protectedHasArray() {
+        return true;
+    }
 
+    @Override
+    public IntBuffer put(int c) {
+        if (position == limit) {
+            throw new BufferOverflowException();
+        }
+        backingArray[offset + position++] = c;
+        return this;
+    }
+
+    @Override
+    public IntBuffer put(int index, int c) {
+        if (index < 0 || index >= limit) {
+            throw new IndexOutOfBoundsException();
+        }
+        backingArray[offset + index] = c;
+        return this;
+    }
+
+    @Override
     public IntBuffer put(int[] src, int off, int len) {
         int length = src.length;
-        if (off < 0 || len < 0 || (long)off + (long)len > length) {
+        if (off < 0 || len < 0 || (long) off + (long) len > length) {
             throw new IndexOutOfBoundsException();
         }
         if (len > remaining()) {
             throw new BufferOverflowException();
         }
-        System.arraycopy(src, off, backingArray, offset
-                + position, len);
+        System.arraycopy(src, off, backingArray, offset + position, len);
         position += len;
         return this;
     }
-    
-	public IntBuffer slice() {
-		return new ReadWriteIntArrayBuffer(remaining(), backingArray, offset
-				+ position);
-	}
+
+    @Override
+    public IntBuffer slice() {
+        return new ReadWriteIntArrayBuffer(remaining(), backingArray, offset
+                + position);
+    }
 
 }

Modified: harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadWriteLongArrayBuffer.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadWriteLongArrayBuffer.java?rev=578091&r1=578090&r2=578091&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadWriteLongArrayBuffer.java (original)
+++ harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadWriteLongArrayBuffer.java Fri Sep 21 06:05:59 2007
@@ -30,93 +30,103 @@
  */
 final class ReadWriteLongArrayBuffer extends LongArrayBuffer {
 
-	static ReadWriteLongArrayBuffer copy(LongArrayBuffer other, int markOfOther) {
-		ReadWriteLongArrayBuffer buf = new ReadWriteLongArrayBuffer(other
-				.capacity(), other.backingArray, other.offset);
-		buf.limit = other.limit();
-		buf.position = other.position();
-		buf.mark = markOfOther;
-		return buf;
-	}
-
-	ReadWriteLongArrayBuffer(long[] array) {
-		super(array);
-	}
-
-	ReadWriteLongArrayBuffer(int capacity) {
-		super(capacity);
-	}
-
-	ReadWriteLongArrayBuffer(int capacity, long[] backingArray, int arrayOffset) {
-		super(capacity, backingArray, arrayOffset);
-	}
-
-	public LongBuffer asReadOnlyBuffer() {
-		return ReadOnlyLongArrayBuffer.copy(this, mark);
-	}
-
-	public LongBuffer compact() {
-		System.arraycopy(backingArray, position + offset, backingArray, offset,
-				remaining());
-		position = limit - position;
-		limit = capacity;
-		mark = UNSET_MARK;
-		return this;
-	}
-
-	public LongBuffer duplicate() {
-		return copy(this, mark);
-	}
-
-	public boolean isReadOnly() {
-		return false;
-	}
-
-	protected long[] protectedArray() {
-		return backingArray;
-	}
-
-	protected int protectedArrayOffset() {
-		return offset;
-	}
-
-	protected boolean protectedHasArray() {
-		return true;
-	}
-
-	public LongBuffer put(long c) {
-		if (position == limit) {
-			throw new BufferOverflowException();
-		}
-		backingArray[offset + position++] = c;
-		return this;
-	}
-
-	public LongBuffer put(int index, long c) {
-		if (index < 0 || index >= limit) {
-			throw new IndexOutOfBoundsException();
-		}
-		backingArray[offset + index] = c;
-		return this;
-	}
+    static ReadWriteLongArrayBuffer copy(LongArrayBuffer other, int markOfOther) {
+        ReadWriteLongArrayBuffer buf = new ReadWriteLongArrayBuffer(other
+                .capacity(), other.backingArray, other.offset);
+        buf.limit = other.limit();
+        buf.position = other.position();
+        buf.mark = markOfOther;
+        return buf;
+    }
+
+    ReadWriteLongArrayBuffer(long[] array) {
+        super(array);
+    }
+
+    ReadWriteLongArrayBuffer(int capacity) {
+        super(capacity);
+    }
+
+    ReadWriteLongArrayBuffer(int capacity, long[] backingArray, int arrayOffset) {
+        super(capacity, backingArray, arrayOffset);
+    }
+
+    @Override
+    public LongBuffer asReadOnlyBuffer() {
+        return ReadOnlyLongArrayBuffer.copy(this, mark);
+    }
+
+    @Override
+    public LongBuffer compact() {
+        System.arraycopy(backingArray, position + offset, backingArray, offset,
+                remaining());
+        position = limit - position;
+        limit = capacity;
+        mark = UNSET_MARK;
+        return this;
+    }
+
+    @Override
+    public LongBuffer duplicate() {
+        return copy(this, mark);
+    }
+
+    @Override
+    public boolean isReadOnly() {
+        return false;
+    }
+
+    @Override
+    protected long[] protectedArray() {
+        return backingArray;
+    }
+
+    @Override
+    protected int protectedArrayOffset() {
+        return offset;
+    }
+
+    @Override
+    protected boolean protectedHasArray() {
+        return true;
+    }
 
+    @Override
+    public LongBuffer put(long c) {
+        if (position == limit) {
+            throw new BufferOverflowException();
+        }
+        backingArray[offset + position++] = c;
+        return this;
+    }
+
+    @Override
+    public LongBuffer put(int index, long c) {
+        if (index < 0 || index >= limit) {
+            throw new IndexOutOfBoundsException();
+        }
+        backingArray[offset + index] = c;
+        return this;
+    }
+
+    @Override
     public LongBuffer put(long[] src, int off, int len) {
         int length = src.length;
-        if (off < 0 || len < 0 || (long)off + (long)len > length) {
+        if (off < 0 || len < 0 || (long) off + (long) len > length) {
             throw new IndexOutOfBoundsException();
         }
         if (len > remaining()) {
             throw new BufferOverflowException();
         }
-        System.arraycopy(src, off, backingArray, offset
-                + position, len);
+        System.arraycopy(src, off, backingArray, offset + position, len);
         position += len;
         return this;
     }
-    
-	public LongBuffer slice() {
-		return new ReadWriteLongArrayBuffer(remaining(), backingArray, offset
-				+ position);
-	}
+
+    @Override
+    public LongBuffer slice() {
+        return new ReadWriteLongArrayBuffer(remaining(), backingArray, offset
+                + position);
+    }
 
 }

Modified: harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadWriteShortArrayBuffer.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadWriteShortArrayBuffer.java?rev=578091&r1=578090&r2=578091&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadWriteShortArrayBuffer.java (original)
+++ harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadWriteShortArrayBuffer.java Fri Sep 21 06:05:59 2007
@@ -31,94 +31,105 @@
  */
 final class ReadWriteShortArrayBuffer extends ShortArrayBuffer {
 
-	static ReadWriteShortArrayBuffer copy(ShortArrayBuffer other,
-			int markOfOther) {
-		ReadWriteShortArrayBuffer buf = new ReadWriteShortArrayBuffer(other
-				.capacity(), other.backingArray, other.offset);
-		buf.limit = other.limit();
-		buf.position = other.position();
-		buf.mark = markOfOther;
-		return buf;
-	}
-
-	ReadWriteShortArrayBuffer(short[] array) {
-		super(array);
-	}
-
-	ReadWriteShortArrayBuffer(int capacity) {
-		super(capacity);
-	}
-
-	ReadWriteShortArrayBuffer(int capacity, short[] backingArray,
-			int arrayOffset) {
-		super(capacity, backingArray, arrayOffset);
-	}
-
-	public ShortBuffer asReadOnlyBuffer() {
-		return ReadOnlyShortArrayBuffer.copy(this, mark);
-	}
-
-	public ShortBuffer compact() {
-		System.arraycopy(backingArray, position + offset, backingArray, offset,
-				remaining());
-		position = limit - position;
-		limit = capacity;
-		mark = UNSET_MARK;
-		return this;
-	}
-
-	public ShortBuffer duplicate() {
-		return copy(this, mark);
-	}
-
-	public boolean isReadOnly() {
-		return false;
-	}
-
-	protected short[] protectedArray() {
-		return backingArray;
-	}
-
-	protected int protectedArrayOffset() {
-		return offset;
-	}
-
-	protected boolean protectedHasArray() {
-		return true;
-	}
-
-	public ShortBuffer put(short c) {
-		if (position == limit) {
-			throw new BufferOverflowException();
-		}
-		backingArray[offset + position++] = c;
-		return this;
-	}
-
-	public ShortBuffer put(int index, short c) {
-		if (index < 0 || index >= limit) {
-			throw new IndexOutOfBoundsException();
-		}
-		backingArray[offset + index] = c;
-		return this;
-	}
+    static ReadWriteShortArrayBuffer copy(ShortArrayBuffer other,
+            int markOfOther) {
+        ReadWriteShortArrayBuffer buf = new ReadWriteShortArrayBuffer(other
+                .capacity(), other.backingArray, other.offset);
+        buf.limit = other.limit();
+        buf.position = other.position();
+        buf.mark = markOfOther;
+        return buf;
+    }
+
+    ReadWriteShortArrayBuffer(short[] array) {
+        super(array);
+    }
+
+    ReadWriteShortArrayBuffer(int capacity) {
+        super(capacity);
+    }
+
+    ReadWriteShortArrayBuffer(int capacity, short[] backingArray,
+            int arrayOffset) {
+        super(capacity, backingArray, arrayOffset);
+    }
+
+    @Override
+    public ShortBuffer asReadOnlyBuffer() {
+        return ReadOnlyShortArrayBuffer.copy(this, mark);
+    }
+
+    @Override
+    public ShortBuffer compact() {
+        System.arraycopy(backingArray, position + offset, backingArray, offset,
+                remaining());
+        position = limit - position;
+        limit = capacity;
+        mark = UNSET_MARK;
+        return this;
+    }
+
+    @Override
+    public ShortBuffer duplicate() {
+        return copy(this, mark);
+    }
+
+    @Override
+    public boolean isReadOnly() {
+        return false;
+    }
+
+    @Override
+    protected short[] protectedArray() {
+        return backingArray;
+    }
+
+    @Override
+    protected int protectedArrayOffset() {
+        return offset;
+    }
+
+    @Override
+    protected boolean protectedHasArray() {
+        return true;
+    }
 
+    @Override
+    public ShortBuffer put(short c) {
+        if (position == limit) {
+            throw new BufferOverflowException();
+        }
+        backingArray[offset + position++] = c;
+        return this;
+    }
+
+    @Override
+    public ShortBuffer put(int index, short c) {
+        if (index < 0 || index >= limit) {
+            throw new IndexOutOfBoundsException();
+        }
+        backingArray[offset + index] = c;
+        return this;
+    }
+
+    @Override
     public ShortBuffer put(short[] src, int off, int len) {
         int length = src.length;
-        if (off < 0 || len < 0 || (long)off + (long)len > length) {
+        if (off < 0 || len < 0 || (long) off + (long) len > length) {
             throw new IndexOutOfBoundsException();
         }
         if (len > remaining()) {
             throw new BufferOverflowException();
         }
-        System.arraycopy(src, off, backingArray, offset+position, len);
+        System.arraycopy(src, off, backingArray, offset + position, len);
         position += len;
         return this;
     }
-    
-	public ShortBuffer slice() {
-		return new ReadWriteShortArrayBuffer(remaining(), backingArray, offset
-				+ position);
-	}
+
+    @Override
+    public ShortBuffer slice() {
+        return new ReadWriteShortArrayBuffer(remaining(), backingArray, offset
+                + position);
+    }
 
 }

Modified: harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ShortArrayBuffer.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ShortArrayBuffer.java?rev=578091&r1=578090&r2=578091&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ShortArrayBuffer.java (original)
+++ harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ShortArrayBuffer.java Fri Sep 21 06:05:59 2007
@@ -31,58 +31,62 @@
  */
 abstract class ShortArrayBuffer extends ShortBuffer {
 
-	protected final short[] backingArray;
+    protected final short[] backingArray;
 
-	protected final int offset;
+    protected final int offset;
 
-	ShortArrayBuffer(short[] array) {
-		this(array.length, array, 0);
-	}
-
-	ShortArrayBuffer(int capacity) {
-		this(capacity, new short[capacity], 0);
-	}
-
-	ShortArrayBuffer(int capacity, short[] backingArray, int offset) {
-		super(capacity);
-		this.backingArray = backingArray;
-		this.offset = offset;
-	}
-
-	public final short get() {
-		if (position == limit) {
-			throw new BufferUnderflowException();
-		}
-		return backingArray[offset + position++];
-	}
-
-	public final short get(int index) {
-		if (index < 0 || index >= limit) {
-			throw new IndexOutOfBoundsException();
-		}
-		return backingArray[offset + index];
-	}
+    ShortArrayBuffer(short[] array) {
+        this(array.length, array, 0);
+    }
+
+    ShortArrayBuffer(int capacity) {
+        this(capacity, new short[capacity], 0);
+    }
+
+    ShortArrayBuffer(int capacity, short[] backingArray, int offset) {
+        super(capacity);
+        this.backingArray = backingArray;
+        this.offset = offset;
+    }
+
+    @Override
+    public final short get() {
+        if (position == limit) {
+            throw new BufferUnderflowException();
+        }
+        return backingArray[offset + position++];
+    }
 
+    @Override
+    public final short get(int index) {
+        if (index < 0 || index >= limit) {
+            throw new IndexOutOfBoundsException();
+        }
+        return backingArray[offset + index];
+    }
+
+    @Override
     public final ShortBuffer get(short[] dest, int off, int len) {
         int length = dest.length;
-        if (off < 0 || len < 0 || (long)off + (long)len > length) {
+        if (off < 0 || len < 0 || (long) off + (long) len > length) {
             throw new IndexOutOfBoundsException();
         }
         if (len > remaining()) {
             throw new BufferUnderflowException();
         }
-        System.arraycopy(backingArray, offset + position, dest,
-                off, len);
+        System.arraycopy(backingArray, offset + position, dest, off, len);
         position += len;
         return this;
     }
-    
-	public final boolean isDirect() {
-		return false;
-	}
-
-	public final ByteOrder order() {
-		return ByteOrder.nativeOrder();
-	}
+
+    @Override
+    public final boolean isDirect() {
+        return false;
+    }
+
+    @Override
+    public final ByteOrder order() {
+        return ByteOrder.nativeOrder();
+    }
 
 }



Mime
View raw message