summaryrefslogtreecommitdiffstats
path: root/libjava/classpath/java/nio
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/java/nio')
-rw-r--r--libjava/classpath/java/nio/Buffer.java38
-rw-r--r--libjava/classpath/java/nio/BufferOverflowException.java2
-rw-r--r--libjava/classpath/java/nio/BufferUnderflowException.java2
-rw-r--r--libjava/classpath/java/nio/ByteBuffer.java118
-rw-r--r--libjava/classpath/java/nio/ByteBufferHelper.java49
-rw-r--r--libjava/classpath/java/nio/ByteBufferImpl.java68
-rw-r--r--libjava/classpath/java/nio/ByteOrder.java2
-rw-r--r--libjava/classpath/java/nio/CharBuffer.java80
-rw-r--r--libjava/classpath/java/nio/CharBufferImpl.java42
-rw-r--r--libjava/classpath/java/nio/CharSequenceBuffer.java4
-rw-r--r--libjava/classpath/java/nio/CharViewBufferImpl.java40
-rw-r--r--libjava/classpath/java/nio/DirectByteBufferImpl.java84
-rw-r--r--libjava/classpath/java/nio/DoubleBuffer.java52
-rw-r--r--libjava/classpath/java/nio/DoubleBufferImpl.java36
-rw-r--r--libjava/classpath/java/nio/DoubleViewBufferImpl.java26
-rw-r--r--libjava/classpath/java/nio/FloatBuffer.java52
-rw-r--r--libjava/classpath/java/nio/FloatBufferImpl.java30
-rw-r--r--libjava/classpath/java/nio/FloatViewBufferImpl.java34
-rw-r--r--libjava/classpath/java/nio/IntBuffer.java52
-rw-r--r--libjava/classpath/java/nio/IntBufferImpl.java26
-rw-r--r--libjava/classpath/java/nio/IntViewBufferImpl.java34
-rw-r--r--libjava/classpath/java/nio/InvalidMarkException.java2
-rw-r--r--libjava/classpath/java/nio/LongBuffer.java50
-rw-r--r--libjava/classpath/java/nio/LongBufferImpl.java32
-rw-r--r--libjava/classpath/java/nio/LongViewBufferImpl.java34
-rw-r--r--libjava/classpath/java/nio/MappedByteBuffer.java10
-rw-r--r--libjava/classpath/java/nio/MappedByteBufferImpl.java58
-rw-r--r--libjava/classpath/java/nio/ReadOnlyBufferException.java2
-rw-r--r--libjava/classpath/java/nio/ShortBuffer.java52
-rw-r--r--libjava/classpath/java/nio/ShortBufferImpl.java34
-rw-r--r--libjava/classpath/java/nio/ShortViewBufferImpl.java36
-rw-r--r--libjava/classpath/java/nio/channels/FileChannel.java4
-rw-r--r--libjava/classpath/java/nio/channels/SocketChannel.java16
-rw-r--r--libjava/classpath/java/nio/channels/spi/AbstractInterruptibleChannel.java12
-rw-r--r--libjava/classpath/java/nio/channels/spi/AbstractSelectableChannel.java56
-rw-r--r--libjava/classpath/java/nio/channels/spi/AbstractSelectionKey.java4
-rw-r--r--libjava/classpath/java/nio/channels/spi/AbstractSelector.java2
-rw-r--r--libjava/classpath/java/nio/channels/spi/SelectorProvider.java50
-rw-r--r--libjava/classpath/java/nio/charset/CharacterCodingException.java2
-rw-r--r--libjava/classpath/java/nio/charset/Charset.java92
-rw-r--r--libjava/classpath/java/nio/charset/CharsetDecoder.java6
-rw-r--r--libjava/classpath/java/nio/charset/CharsetEncoder.java8
-rw-r--r--libjava/classpath/java/nio/charset/CoderMalfunctionError.java2
-rw-r--r--libjava/classpath/java/nio/charset/CoderResult.java10
-rw-r--r--libjava/classpath/java/nio/charset/CodingErrorAction.java8
-rw-r--r--libjava/classpath/java/nio/charset/IllegalCharsetNameException.java6
-rw-r--r--libjava/classpath/java/nio/charset/MalformedInputException.java4
-rw-r--r--libjava/classpath/java/nio/charset/UnmappableCharacterException.java4
-rw-r--r--libjava/classpath/java/nio/charset/UnsupportedCharsetException.java6
49 files changed, 736 insertions, 737 deletions
diff --git a/libjava/classpath/java/nio/Buffer.java b/libjava/classpath/java/nio/Buffer.java
index 5dc67025537..023ab0e1d18 100644
--- a/libjava/classpath/java/nio/Buffer.java
+++ b/libjava/classpath/java/nio/Buffer.java
@@ -1,4 +1,4 @@
-/* Buffer.java --
+/* Buffer.java --
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -57,22 +57,22 @@ public abstract class Buffer
* Should be package private.
*/
Buffer (int capacity, int limit, int position, int mark,
- Pointer address)
+ Pointer address)
{
this.address = address;
if (capacity < 0)
throw new IllegalArgumentException ();
-
+
cap = capacity;
limit (limit);
position (position);
-
+
if (mark >= 0)
{
if (mark > pos)
throw new IllegalArgumentException ();
-
+
this.mark = mark;
}
else
@@ -80,7 +80,7 @@ public abstract class Buffer
this.mark = -1;
}
}
-
+
/**
* Retrieves the capacity of the buffer.
*
@@ -103,7 +103,7 @@ public abstract class Buffer
mark = -1;
return this;
}
-
+
/**
* Flips the buffer.
*
@@ -116,7 +116,7 @@ public abstract class Buffer
mark = -1;
return this;
}
-
+
/**
* Tells whether the buffer has remaining data to read or not.
*
@@ -147,7 +147,7 @@ public abstract class Buffer
/**
* Sets this buffer's limit.
- *
+ *
* @param newLimit The new limit value; must be non-negative and no larger
* than this buffer's capacity.
*
@@ -191,11 +191,11 @@ public abstract class Buffer
{
return pos;
}
-
+
/**
* Sets this buffer's position. If the mark is defined and larger than the
* new position then it is discarded.
- *
+ *
* @param newPosition The new position value; must be non-negative and no
* larger than the current limit.
*
@@ -257,7 +257,7 @@ public abstract class Buffer
/**
* Checks for underflow. This method is used internally to check
- * whether a buffer has enough elements left to satisfy a read
+ * whether a buffer has enough elements left to satisfy a read
* request.
*
* @exception BufferUnderflowException If there are no remaining
@@ -271,12 +271,12 @@ public abstract class Buffer
/**
* Checks for underflow. This method is used internally to check
- * whether a buffer has enough elements left to satisfy a read
+ * whether a buffer has enough elements left to satisfy a read
* request for a given number of elements.
*
* @param length The length of a sequence of elements.
*
- * @exception BufferUnderflowException If there are not enough
+ * @exception BufferUnderflowException If there are not enough
* remaining elements in this buffer.
*/
final void checkForUnderflow(int length)
@@ -287,7 +287,7 @@ public abstract class Buffer
/**
* Checks for overflow. This method is used internally to check
- * whether a buffer has enough space left to satisfy a write
+ * whether a buffer has enough space left to satisfy a write
* request.
*
* @exception BufferOverflowException If there is no remaining
@@ -301,12 +301,12 @@ public abstract class Buffer
/**
* Checks for overflow. This method is used internally to check
- * whether a buffer has enough space left to satisfy a write
+ * whether a buffer has enough space left to satisfy a write
* request for a given number of elements.
*
* @param length The length of a sequence of elements.
*
- * @exception BufferUnderflowException If there is not enough
+ * @exception BufferUnderflowException If there is not enough
* remaining space in this buffer.
*/
final void checkForOverflow(int length)
@@ -316,7 +316,7 @@ public abstract class Buffer
}
/**
- * Checks if index is negative or not smaller than the buffer's
+ * Checks if index is negative or not smaller than the buffer's
* limit. This method is used internally to check whether
* an indexed request can be fulfilled.
*
@@ -338,7 +338,7 @@ public abstract class Buffer
*
* @exception ReadOnlyBufferException If this buffer is read-only.
*/
- final void checkIfReadOnly()
+ final void checkIfReadOnly()
{
if (isReadOnly())
throw new ReadOnlyBufferException ();
diff --git a/libjava/classpath/java/nio/BufferOverflowException.java b/libjava/classpath/java/nio/BufferOverflowException.java
index c72ae923801..eac79ed750d 100644
--- a/libjava/classpath/java/nio/BufferOverflowException.java
+++ b/libjava/classpath/java/nio/BufferOverflowException.java
@@ -1,4 +1,4 @@
-/* BufferOverflowException.java --
+/* BufferOverflowException.java --
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
diff --git a/libjava/classpath/java/nio/BufferUnderflowException.java b/libjava/classpath/java/nio/BufferUnderflowException.java
index a6d391e00cc..76581371b6a 100644
--- a/libjava/classpath/java/nio/BufferUnderflowException.java
+++ b/libjava/classpath/java/nio/BufferUnderflowException.java
@@ -1,4 +1,4 @@
-/* BufferUnderflowException.java --
+/* BufferUnderflowException.java --
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
diff --git a/libjava/classpath/java/nio/ByteBuffer.java b/libjava/classpath/java/nio/ByteBuffer.java
index 94aae4bf021..00db5bf4f4d 100644
--- a/libjava/classpath/java/nio/ByteBuffer.java
+++ b/libjava/classpath/java/nio/ByteBuffer.java
@@ -1,4 +1,4 @@
-/* ByteBuffer.java --
+/* ByteBuffer.java --
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -53,7 +53,7 @@ public abstract class ByteBuffer extends Buffer
final int array_offset;
ByteBuffer (int capacity, int limit, int position, int mark,
- RawData address, byte[] backing_buffer, int array_offset)
+ RawData address, byte[] backing_buffer, int array_offset)
{
super (capacity, limit, position, mark, address);
this.backing_buffer = backing_buffer;
@@ -62,7 +62,7 @@ public abstract class ByteBuffer extends Buffer
/**
* Allocates a new direct byte buffer.
- */
+ */
public static ByteBuffer allocateDirect (int capacity)
{
return DirectByteBufferImpl.allocate (capacity);
@@ -104,7 +104,7 @@ public abstract class ByteBuffer extends Buffer
{
return wrap (array, 0, array.length);
}
-
+
/**
* This method transfers <code>byte</code>s from this buffer into the given
* destination array. Before the transfer, it checks if there are fewer than
@@ -187,7 +187,7 @@ public abstract class ByteBuffer extends Buffer
* must be non-negative and no larger than src.length.
* @param length The number of bytes to be read from the given array;
* must be non-negative and no larger than src.length - offset.
- *
+ *
* @exception BufferOverflowException If there is insufficient space in this
* buffer for the remaining <code>byte</code>s in the source array.
* @exception IndexOutOfBoundsException If the preconditions on the offset
@@ -210,7 +210,7 @@ public abstract class ByteBuffer extends Buffer
* into the buffer.
*
* @param src The array to copy into the buffer.
- *
+ *
* @exception BufferOverflowException If there is insufficient space in this
* buffer for the remaining <code>byte</code>s in the source array.
* @exception ReadOnlyBufferException If this buffer is read-only.
@@ -243,7 +243,7 @@ public abstract class ByteBuffer extends Buffer
throw new UnsupportedOperationException ();
checkIfReadOnly();
-
+
return backing_buffer;
}
@@ -260,7 +260,7 @@ public abstract class ByteBuffer extends Buffer
throw new UnsupportedOperationException ();
checkIfReadOnly();
-
+
return array_offset;
}
@@ -283,8 +283,8 @@ public abstract class ByteBuffer extends Buffer
int multiplier = 1;
for (int i = position() + 1; i < limit(); ++i)
{
- multiplier *= 31;
- hashCode += (get(i) + 30)*multiplier;
+ multiplier *= 31;
+ hashCode += (get(i) + 30)*multiplier;
}
return hashCode;
}
@@ -313,32 +313,32 @@ public abstract class ByteBuffer extends Buffer
int num = Math.min(remaining(), other.remaining());
int pos_this = position();
int pos_other = other.position();
-
+
for (int count = 0; count < num; count++)
{
byte a = get(pos_this++);
- byte b = other.get(pos_other++);
-
- if (a == b)
- continue;
-
- if (a < b)
- return -1;
-
- return 1;
+ byte b = other.get(pos_other++);
+
+ if (a == b)
+ continue;
+
+ if (a < b)
+ return -1;
+
+ return 1;
}
-
+
return remaining() - other.remaining();
}
/**
* Returns the byte order of this buffer.
- */
+ */
public final ByteOrder order ()
{
return endian;
}
-
+
/**
* Modifies this buffer's byte order.
*/
@@ -347,7 +347,7 @@ public abstract class ByteBuffer extends Buffer
this.endian = endian;
return this;
}
-
+
/**
* Reads the <code>byte</code> at this buffer's current position,
* and then increments the position.
@@ -361,7 +361,7 @@ public abstract class ByteBuffer extends Buffer
* Writes the <code>byte</code> at this buffer's current position,
* and then increments the position.
*
- * @exception BufferOverflowException If there no remaining
+ * @exception BufferOverflowException If there no remaining
* <code>byte</code>s in this buffer.
* @exception ReadOnlyBufferException If this buffer is read-only.
*/
@@ -374,7 +374,7 @@ public abstract class ByteBuffer extends Buffer
* than the buffer's limit.
*/
public abstract byte get (int index);
-
+
/**
* Absolute put method.
*
@@ -386,7 +386,7 @@ public abstract class ByteBuffer extends Buffer
/**
* Compacts this buffer.
- *
+ *
* @exception ReadOnlyBufferException If this buffer is read-only.
*/
public abstract ByteBuffer compact ();
@@ -419,32 +419,32 @@ public abstract class ByteBuffer extends Buffer
* buffer's content.
*/
public abstract ByteBuffer asReadOnlyBuffer ();
-
+
/**
* Creates a view of this byte buffer as a short buffer.
*/
public abstract ShortBuffer asShortBuffer ();
-
+
/**
* Creates a view of this byte buffer as a char buffer.
*/
public abstract CharBuffer asCharBuffer ();
-
+
/**
* Creates a view of this byte buffer as an integer buffer.
*/
public abstract IntBuffer asIntBuffer ();
-
+
/**
* Creates a view of this byte buffer as a long buffer.
*/
public abstract LongBuffer asLongBuffer ();
-
+
/**
* Creates a view of this byte buffer as a float buffer.
*/
public abstract FloatBuffer asFloatBuffer ();
-
+
/**
* Creates a view of this byte buffer as a double buffer.
*/
@@ -457,7 +457,7 @@ public abstract class ByteBuffer extends Buffer
* remaining in this buffer.
*/
public abstract char getChar ();
-
+
/**
* Relative put method for writing a character value.
*
@@ -465,7 +465,7 @@ public abstract class ByteBuffer extends Buffer
* not smaller than its limit.
*/
public abstract ByteBuffer putChar (char value);
-
+
/**
* Absolute get method for reading a character value.
*
@@ -473,7 +473,7 @@ public abstract class ByteBuffer extends Buffer
* remaining in this buffer
*/
public abstract char getChar (int index);
-
+
/**
* Absolute put method for writing a character value.
*
@@ -481,7 +481,7 @@ public abstract class ByteBuffer extends Buffer
* than the buffer's limit, minus one.
*/
public abstract ByteBuffer putChar (int index, char value);
-
+
/**
* Relative get method for reading a short value.
*
@@ -489,7 +489,7 @@ public abstract class ByteBuffer extends Buffer
* than the buffer's limit, minus one.
*/
public abstract short getShort ();
-
+
/**
* Relative put method for writing a short value.
*
@@ -497,7 +497,7 @@ public abstract class ByteBuffer extends Buffer
* not smaller than its limit.
*/
public abstract ByteBuffer putShort (short value);
-
+
/**
* Absolute get method for reading a short value.
*
@@ -505,7 +505,7 @@ public abstract class ByteBuffer extends Buffer
* remaining in this buffer
*/
public abstract short getShort (int index);
-
+
/**
* Absolute put method for writing a short value.
*
@@ -513,7 +513,7 @@ public abstract class ByteBuffer extends Buffer
* than the buffer's limit, minus one.
*/
public abstract ByteBuffer putShort (int index, short value);
-
+
/**
* Relative get method for reading an integer value.
*
@@ -521,7 +521,7 @@ public abstract class ByteBuffer extends Buffer
* remaining in this buffer.
*/
public abstract int getInt ();
-
+
/**
* Relative put method for writing an integer value.
*
@@ -529,7 +529,7 @@ public abstract class ByteBuffer extends Buffer
* not smaller than its limit.
*/
public abstract ByteBuffer putInt (int value);
-
+
/**
* Absolute get method for reading an integer value.
*
@@ -537,7 +537,7 @@ public abstract class ByteBuffer extends Buffer
* than the buffer's limit, minus three.
*/
public abstract int getInt (int index);
-
+
/**
* Absolute put method for writing an integer value.
*
@@ -545,7 +545,7 @@ public abstract class ByteBuffer extends Buffer
* than the buffer's limit, minus three.
*/
public abstract ByteBuffer putInt (int index, int value);
-
+
/**
* Relative get method for reading a long value.
*
@@ -553,7 +553,7 @@ public abstract class ByteBuffer extends Buffer
* remaining in this buffer.
*/
public abstract long getLong ();
-
+
/**
* Relative put method for writing a long value.
*
@@ -561,7 +561,7 @@ public abstract class ByteBuffer extends Buffer
* not smaller than its limit.
*/
public abstract ByteBuffer putLong (long value);
-
+
/**
* Absolute get method for reading a long value.
*
@@ -569,7 +569,7 @@ public abstract class ByteBuffer extends Buffer
* than the buffer's limit, minus seven.
*/
public abstract long getLong (int index);
-
+
/**
* Absolute put method for writing a float value.
*
@@ -577,7 +577,7 @@ public abstract class ByteBuffer extends Buffer
* than the buffer's limit, minus seven.
*/
public abstract ByteBuffer putLong (int index, long value);
-
+
/**
* Relative get method for reading a float value.
*
@@ -585,7 +585,7 @@ public abstract class ByteBuffer extends Buffer
* remaining in this buffer.
*/
public abstract float getFloat ();
-
+
/**
* Relative put method for writing a float value.
*
@@ -593,7 +593,7 @@ public abstract class ByteBuffer extends Buffer
* remaining in this buffer.
*/
public abstract ByteBuffer putFloat (float value);
-
+
/**
* Absolute get method for reading a float value.
*
@@ -601,7 +601,7 @@ public abstract class ByteBuffer extends Buffer
* than the buffer's limit, minus three.
*/
public abstract float getFloat (int index);
-
+
/**
* Relative put method for writing a float value.
*
@@ -609,7 +609,7 @@ public abstract class ByteBuffer extends Buffer
* than the buffer's limit, minus three.
*/
public abstract ByteBuffer putFloat (int index, float value);
-
+
/**
* Relative get method for reading a double value.
*
@@ -617,7 +617,7 @@ public abstract class ByteBuffer extends Buffer
* remaining in this buffer.
*/
public abstract double getDouble ();
-
+
/**
* Relative put method for writing a double value.
*
@@ -625,7 +625,7 @@ public abstract class ByteBuffer extends Buffer
* not smaller than its limit.
*/
public abstract ByteBuffer putDouble (double value);
-
+
/**
* Absolute get method for reading a double value.
*
@@ -633,7 +633,7 @@ public abstract class ByteBuffer extends Buffer
* than the buffer's limit, minus seven.
*/
public abstract double getDouble (int index);
-
+
/**
* Absolute put method for writing a double value.
*
@@ -648,8 +648,8 @@ public abstract class ByteBuffer extends Buffer
public String toString ()
{
return getClass ().getName () +
- "[pos=" + position () +
- " lim=" + limit () +
- " cap=" + capacity () + "]";
+ "[pos=" + position () +
+ " lim=" + limit () +
+ " cap=" + capacity () + "]";
}
}
diff --git a/libjava/classpath/java/nio/ByteBufferHelper.java b/libjava/classpath/java/nio/ByteBufferHelper.java
index 6c46ca5d7ab..aee007b508b 100644
--- a/libjava/classpath/java/nio/ByteBufferHelper.java
+++ b/libjava/classpath/java/nio/ByteBufferHelper.java
@@ -1,4 +1,4 @@
-/* ByteBufferImpl.java --
+/* ByteBufferImpl.java --
Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,19 +46,19 @@ final class ByteBufferHelper
{
return (char) getShort (buffer, order);
}
-
+
public static void putChar (ByteBuffer buffer, char value, ByteOrder order)
{
putShort (buffer, (short) value, order);
}
-
+
public static char getChar (ByteBuffer buffer, int index, ByteOrder order)
{
return (char) getShort (buffer, index, order);
}
-
+
public static void putChar (ByteBuffer buffer, int index,
- char value, ByteOrder order)
+ char value, ByteOrder order)
{
putShort (buffer, index, (short) value, order);
}
@@ -76,7 +76,7 @@ final class ByteBufferHelper
return (short) ((buffer.get() << 8)
+ (buffer.get() & 0xff));
}
-
+
public static void putShort (ByteBuffer buffer, short value, ByteOrder order)
{
buffer.checkForOverflow(2);
@@ -92,9 +92,9 @@ final class ByteBufferHelper
buffer.put ((byte) value);
}
}
-
+
public static short getShort (ByteBuffer buffer,
- int index, ByteOrder order)
+ int index, ByteOrder order)
{
if (order == ByteOrder.LITTLE_ENDIAN)
{
@@ -105,9 +105,9 @@ final class ByteBufferHelper
return (short) ((buffer.get (index) << 8)
+ (buffer.get (++index) & 0xff));
}
-
+
public static void putShort (ByteBuffer buffer, int index,
- short value, ByteOrder order)
+ short value, ByteOrder order)
{
if (order == ByteOrder.LITTLE_ENDIAN)
{
@@ -138,7 +138,7 @@ final class ByteBufferHelper
+ ((buffer.get() & 0xff) << 8)
+ (buffer.get() & 0xff));
}
-
+
public static void putInt (ByteBuffer buffer, int value, ByteOrder order)
{
buffer.checkForOverflow(4);
@@ -158,7 +158,7 @@ final class ByteBufferHelper
buffer.put ((byte) value);
}
}
-
+
public static int getInt (ByteBuffer buffer, int index, ByteOrder order)
{
if (order == ByteOrder.LITTLE_ENDIAN)
@@ -174,9 +174,9 @@ final class ByteBufferHelper
+ ((buffer.get (++index) & 0xff) << 8)
+ (buffer.get (++index) & 0xff));
}
-
+
public static void putInt (ByteBuffer buffer, int index,
- int value, ByteOrder order)
+ int value, ByteOrder order)
{
if (order == ByteOrder.LITTLE_ENDIAN)
{
@@ -219,7 +219,7 @@ final class ByteBufferHelper
+ ((buffer.get() & 0xff) << 8)
+ (buffer.get() & 0xff));
}
-
+
public static void putLong (ByteBuffer buffer, long value, ByteOrder order)
{
buffer.checkForOverflow(8);
@@ -247,7 +247,7 @@ final class ByteBufferHelper
buffer.put ((byte) value);
}
}
-
+
public static long getLong (ByteBuffer buffer, int index, ByteOrder order)
{
if (order == ByteOrder.LITTLE_ENDIAN)
@@ -271,9 +271,9 @@ final class ByteBufferHelper
+ ((buffer.get (++index) & 0xff) << 8)
+ (buffer.get (++index) & 0xff));
}
-
+
public static void putLong (ByteBuffer buffer, int index,
- long value, ByteOrder order)
+ long value, ByteOrder order)
{
if (order == ByteOrder.LITTLE_ENDIAN)
{
@@ -303,19 +303,19 @@ final class ByteBufferHelper
{
return Float.intBitsToFloat (getInt (buffer, order));
}
-
+
public static void putFloat (ByteBuffer buffer, float value, ByteOrder order)
{
putInt (buffer, Float.floatToRawIntBits (value), order);
}
-
+
public static float getFloat (ByteBuffer buffer, int index, ByteOrder order)
{
return Float.intBitsToFloat (getInt (buffer, index, order));
}
public static void putFloat (ByteBuffer buffer, int index,
- float value, ByteOrder order)
+ float value, ByteOrder order)
{
putInt (buffer, index, Float.floatToRawIntBits (value), order);
}
@@ -329,16 +329,15 @@ final class ByteBufferHelper
{
putLong (buffer, Double.doubleToRawLongBits (value), order);
}
-
+
public static double getDouble (ByteBuffer buffer, int index, ByteOrder order)
{
return Double.longBitsToDouble (getLong (buffer, index, order));
}
-
+
public static void putDouble (ByteBuffer buffer, int index,
- double value, ByteOrder order)
+ double value, ByteOrder order)
{
putLong (buffer, index, Double.doubleToRawLongBits (value), order);
}
} // ByteBufferHelper
-
diff --git a/libjava/classpath/java/nio/ByteBufferImpl.java b/libjava/classpath/java/nio/ByteBufferImpl.java
index 6a1ac4681da..2bf31922066 100644
--- a/libjava/classpath/java/nio/ByteBufferImpl.java
+++ b/libjava/classpath/java/nio/ByteBufferImpl.java
@@ -1,4 +1,4 @@
-/* ByteBufferImpl.java --
+/* ByteBufferImpl.java --
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,12 +46,12 @@ final class ByteBufferImpl extends ByteBuffer
private final boolean readOnly;
ByteBufferImpl (byte[] buffer, int offset, int capacity, int limit,
- int position, int mark, boolean readOnly)
+ int position, int mark, boolean readOnly)
{
super (capacity, limit, position, mark, null, buffer, offset);
this.readOnly = readOnly;
}
-
+
public CharBuffer asCharBuffer ()
{
return new CharViewBufferImpl (this, remaining() >> 1);
@@ -86,30 +86,30 @@ final class ByteBufferImpl extends ByteBuffer
{
return readOnly;
}
-
+
public ByteBuffer slice ()
{
return new ByteBufferImpl (backing_buffer, array_offset + position (),
- remaining (), remaining (), 0, -1, isReadOnly ());
+ remaining (), remaining (), 0, -1, isReadOnly ());
}
-
+
public ByteBuffer duplicate ()
{
return new ByteBufferImpl (backing_buffer, array_offset, capacity (),
- limit (), position (), mark, isReadOnly ());
+ limit (), position (), mark, isReadOnly ());
}
-
+
public ByteBuffer asReadOnlyBuffer ()
{
return new ByteBufferImpl (backing_buffer, array_offset, capacity (),
- limit (), position (), mark, true);
+ limit (), position (), mark, true);
}
-
+
void shiftDown (int dst_offset, int src_offset, int count)
{
System.arraycopy(backing_buffer, array_offset + src_offset,
- backing_buffer, array_offset + dst_offset,
- count);
+ backing_buffer, array_offset + dst_offset,
+ count);
}
public ByteBuffer compact ()
@@ -124,7 +124,7 @@ final class ByteBufferImpl extends ByteBuffer
limit(capacity());
return this;
}
-
+
public boolean isDirect ()
{
return false;
@@ -154,8 +154,8 @@ final class ByteBufferImpl extends ByteBuffer
if ( (limit - pos) < length) // check for overflow
throw new BufferUnderflowException();
- System.arraycopy(backing_buffer, pos + array_offset,
- dst, offset, length);
+ System.arraycopy(backing_buffer, pos + array_offset,
+ dst, offset, length);
pos += length;
return this;
@@ -194,7 +194,7 @@ final class ByteBufferImpl extends ByteBuffer
backing_buffer [(pos++) + array_offset] = value;
return this;
}
-
+
/**
* Absolute get method. Reads the <code>byte</code> at position
* <code>index</code>.
@@ -208,7 +208,7 @@ final class ByteBufferImpl extends ByteBuffer
return backing_buffer [index + array_offset];
}
-
+
/**
* Absolute put method. Writes <code>value</code> to position
* <code>index</code> in the buffer.
@@ -225,12 +225,12 @@ final class ByteBufferImpl extends ByteBuffer
backing_buffer [index + array_offset] = value;
return this;
}
-
+
public char getChar ()
{
return ByteBufferHelper.getChar(this, order());
}
-
+
public ByteBuffer putChar (char value)
{
if (readOnly)
@@ -250,12 +250,12 @@ final class ByteBufferImpl extends ByteBuffer
}
return this;
}
-
+
public char getChar (int index)
{
return ByteBufferHelper.getChar(this, index, order());
}
-
+
public ByteBuffer putChar (int index, char value)
{
ByteBufferHelper.putChar(this, index, value, order());
@@ -266,18 +266,18 @@ final class ByteBufferImpl extends ByteBuffer
{
return ByteBufferHelper.getShort(this, order());
}
-
+
public ByteBuffer putShort (short value)
{
ByteBufferHelper.putShort(this, value, order());
return this;
}
-
+
public short getShort (int index)
{
return ByteBufferHelper.getShort(this, index, order());
}
-
+
public ByteBuffer putShort (int index, short value)
{
ByteBufferHelper.putShort(this, index, value, order());
@@ -288,18 +288,18 @@ final class ByteBufferImpl extends ByteBuffer
{
return ByteBufferHelper.getInt(this, order());
}
-
+
public ByteBuffer putInt (int value)
{
ByteBufferHelper.putInt(this, value, order());
return this;
}
-
+
public int getInt (int index)
{
return ByteBufferHelper.getInt(this, index, order());
}
-
+
public ByteBuffer putInt (int index, int value)
{
ByteBufferHelper.putInt(this, index, value, order());
@@ -310,18 +310,18 @@ final class ByteBufferImpl extends ByteBuffer
{
return ByteBufferHelper.getLong(this, order());
}
-
+
public ByteBuffer putLong (long value)
{
ByteBufferHelper.putLong (this, value, order());
return this;
}
-
+
public long getLong (int index)
{
return ByteBufferHelper.getLong (this, index, order());
}
-
+
public ByteBuffer putLong (int index, long value)
{
ByteBufferHelper.putLong (this, index, value, order());
@@ -332,13 +332,13 @@ final class ByteBufferImpl extends ByteBuffer
{
return ByteBufferHelper.getFloat (this, order());
}
-
+
public ByteBuffer putFloat (float value)
{
ByteBufferHelper.putFloat (this, value, order());
return this;
}
-
+
public float getFloat (int index)
{
return ByteBufferHelper.getFloat (this, index, order());
@@ -360,12 +360,12 @@ final class ByteBufferImpl extends ByteBuffer
ByteBufferHelper.putDouble (this, value, order());
return this;
}
-
+
public double getDouble (int index)
{
return ByteBufferHelper.getDouble (this, index, order());
}
-
+
public ByteBuffer putDouble (int index, double value)
{
ByteBufferHelper.putDouble (this, index, value, order());
diff --git a/libjava/classpath/java/nio/ByteOrder.java b/libjava/classpath/java/nio/ByteOrder.java
index 0e3b9173eb6..364aa182981 100644
--- a/libjava/classpath/java/nio/ByteOrder.java
+++ b/libjava/classpath/java/nio/ByteOrder.java
@@ -1,4 +1,4 @@
-/* ByteOrder.java --
+/* ByteOrder.java --
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
diff --git a/libjava/classpath/java/nio/CharBuffer.java b/libjava/classpath/java/nio/CharBuffer.java
index 969b5bb3df3..a1729e6e79c 100644
--- a/libjava/classpath/java/nio/CharBuffer.java
+++ b/libjava/classpath/java/nio/CharBuffer.java
@@ -1,4 +1,4 @@
-/* CharBuffer.java --
+/* CharBuffer.java --
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -53,7 +53,7 @@ public abstract class CharBuffer extends Buffer
final char[] backing_buffer;
CharBuffer (int capacity, int limit, int position, int mark,
- RawData address, char[] backing_buffer, int array_offset)
+ RawData address, char[] backing_buffer, int array_offset)
{
super (capacity, limit, position, mark, address);
this.backing_buffer = backing_buffer;
@@ -77,16 +77,16 @@ public abstract class CharBuffer extends Buffer
* @param length the length of the region in the array to wrap
*
* @return a new <code>CharBuffer</code> object
- *
+ *
* @exception IndexOutOfBoundsException If the preconditions on the offset
* and length parameters do not hold
*/
public static final CharBuffer wrap(char[] array, int offset, int length)
{
return new CharBufferImpl(array, 0, array.length, offset + length, offset,
- -1, false);
+ -1, false);
}
-
+
/**
* Wraps a character sequence into a <code>CharBuffer</code> object.
*
@@ -98,16 +98,16 @@ public abstract class CharBuffer extends Buffer
{
return wrap(seq, 0, seq.length());
}
-
+
/**
* Wraps a character sequence into a <code>CharBuffer</code> object.
- *
+ *
* @param seq the sequence to wrap
* @param start the index of the first character to wrap
* @param end the index of the first character not to wrap
*
* @return a new <code>CharBuffer</code> object
- *
+ *
* @exception IndexOutOfBoundsException If the preconditions on the offset
* and length parameters do not hold
*/
@@ -128,11 +128,11 @@ public abstract class CharBuffer extends Buffer
{
return wrap(array, 0, array.length);
}
-
+
/**
* This method transfers <code>char</code>s from this buffer into the given
* destination array. Before the transfer, it checks if there are fewer than
- * length <code>char</code>s remaining in this buffer.
+ * length <code>char</code>s remaining in this buffer.
*
* @param dst The destination array
* @param offset The offset within the array of the first <code>char</code>
@@ -207,7 +207,7 @@ public abstract class CharBuffer extends Buffer
{
char[] toPut = new char [src.remaining ()];
src.get (toPut);
- put (toPut);
+ put (toPut);
}
return this;
@@ -223,7 +223,7 @@ public abstract class CharBuffer extends Buffer
* must be non-negative and no larger than src.length.
* @param length The number of bytes to be read from the given array;
* must be non-negative and no larger than src.length - offset.
- *
+ *
* @exception BufferOverflowException If there is insufficient space in this
* buffer for the remaining <code>char</code>s in the source array.
* @exception IndexOutOfBoundsException If the preconditions on the offset
@@ -234,7 +234,7 @@ public abstract class CharBuffer extends Buffer
{
checkArraySize(src.length, offset, length);
checkForOverflow(length);
-
+
for (int i = offset; i < offset + length; i++)
put (src [i]);
@@ -246,7 +246,7 @@ public abstract class CharBuffer extends Buffer
* into the buffer.
*
* @param src The array to copy into the buffer.
- *
+ *
* @exception BufferOverflowException If there is insufficient space in this
* buffer for the remaining <code>char</code>s in the source array.
* @exception ReadOnlyBufferException If this buffer is read-only.
@@ -296,7 +296,7 @@ public abstract class CharBuffer extends Buffer
throw new UnsupportedOperationException ();
checkIfReadOnly();
-
+
return array_offset;
}
@@ -317,8 +317,8 @@ public abstract class CharBuffer extends Buffer
int multiplier = 1;
for (int i = position() + 1; i < limit(); ++i)
{
- multiplier *= 31;
- hashCode += (get(i) + 30)*multiplier;
+ multiplier *= 31;
+ hashCode += (get(i) + 30)*multiplier;
}
return hashCode;
}
@@ -347,21 +347,21 @@ public abstract class CharBuffer extends Buffer
int num = Math.min(remaining(), other.remaining());
int pos_this = position();
int pos_other = other.position();
-
+
for (int count = 0; count < num; count++)
{
- char a = get(pos_this++);
- char b = other.get(pos_other++);
-
- if (a == b)
- continue;
-
- if (a < b)
- return -1;
-
- return 1;
+ char a = get(pos_this++);
+ char b = other.get(pos_other++);
+
+ if (a == b)
+ continue;
+
+ if (a < b)
+ return -1;
+
+ return 1;
}
-
+
return remaining() - other.remaining();
}
@@ -383,7 +383,7 @@ public abstract class CharBuffer extends Buffer
* Writes the <code>char</code> at this buffer's current position,
* and then increments the position.
*
- * @exception BufferOverflowException If there no remaining
+ * @exception BufferOverflowException If there no remaining
* <code>char</code>s in this buffer.
* @exception ReadOnlyBufferException If this buffer is read-only.
*/
@@ -396,7 +396,7 @@ public abstract class CharBuffer extends Buffer
* than the buffer's limit.
*/
public abstract char get (int index);
-
+
/**
* Absolute put method.
*
@@ -408,7 +408,7 @@ public abstract class CharBuffer extends Buffer
/**
* Compacts this buffer.
- *
+ *
* @exception ReadOnlyBufferException If this buffer is read-only.
*/
public abstract CharBuffer compact ();
@@ -435,7 +435,7 @@ public abstract class CharBuffer extends Buffer
* buffer's content.
*/
public abstract CharBuffer asReadOnlyBuffer ();
-
+
/**
* Returns the remaining content of the buffer as a string.
*/
@@ -455,7 +455,7 @@ public abstract class CharBuffer extends Buffer
* Returns the length of the remaining chars in this buffer.
*/
public final int length ()
- {
+ {
return remaining ();
}
@@ -470,7 +470,7 @@ public abstract class CharBuffer extends Buffer
/**
* Relative put method.
- *
+ *
* @exception BufferOverflowException If there is insufficient space in this
* buffer.
* @exception IndexOutOfBoundsException If the preconditions on the start
@@ -481,10 +481,10 @@ public abstract class CharBuffer extends Buffer
{
return put (str.toCharArray (), start, length);
}
-
+
/**
* Relative put method.
- *
+ *
* @exception BufferOverflowException If there is insufficient space in this
* buffer.
* @exception ReadOnlyBufferException If this buffer is read-only.
@@ -493,10 +493,10 @@ public abstract class CharBuffer extends Buffer
{
return put (str.toCharArray (), 0, str.length ());
}
-
+
/**
* Returns the character at <code>position() + index</code>.
- *
+ *
* @exception IndexOutOfBoundsException If index is negative not smaller than
* <code>remaining()</code>.
*/
@@ -505,7 +505,7 @@ public abstract class CharBuffer extends Buffer
if (index < 0
|| index >= remaining ())
throw new IndexOutOfBoundsException ();
-
+
return get (position () + index);
}
diff --git a/libjava/classpath/java/nio/CharBufferImpl.java b/libjava/classpath/java/nio/CharBufferImpl.java
index d35ca5962f1..8df9dbbea5a 100644
--- a/libjava/classpath/java/nio/CharBufferImpl.java
+++ b/libjava/classpath/java/nio/CharBufferImpl.java
@@ -1,4 +1,4 @@
-/* CharBufferImpl.java --
+/* CharBufferImpl.java --
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -49,39 +49,39 @@ final class CharBufferImpl extends CharBuffer
{
this (new char [capacity], 0, capacity, capacity, 0, -1, false);
}
-
+
CharBufferImpl (char[] buffer, int offset, int capacity, int limit, int position, int mark, boolean readOnly)
{
super (capacity, limit, position, mark, null, buffer, offset);
this.readOnly = readOnly;
}
-
+
public CharBufferImpl (CharBufferImpl copy)
{
super (copy.capacity (), copy.limit (), copy.position (), 0, null, copy.backing_buffer, copy.array_offset);
this.readOnly = copy.isReadOnly ();
}
-
+
public boolean isReadOnly ()
{
return readOnly;
}
-
+
public CharBuffer slice ()
{
return new CharBufferImpl (backing_buffer, array_offset + position (), remaining (), remaining (), 0, -1, isReadOnly ());
}
-
+
public CharBuffer duplicate ()
{
return new CharBufferImpl (backing_buffer, array_offset, capacity (), limit (), position (), mark, isReadOnly ());
}
-
+
public CharBuffer asReadOnlyBuffer ()
{
return new CharBufferImpl (backing_buffer, array_offset, capacity (), limit (), position (), mark, true);
}
-
+
public CharBuffer compact ()
{
checkIfReadOnly();
@@ -97,7 +97,7 @@ final class CharBufferImpl extends CharBuffer
limit(capacity());
return this;
}
-
+
public boolean isDirect ()
{
return false;
@@ -113,7 +113,7 @@ final class CharBufferImpl extends CharBuffer
return new CharBufferImpl (backing_buffer, array_offset, capacity (), position () + end, position () + start, -1, isReadOnly ());
}
-
+
/**
* Reads the <code>char</code> at this buffer's current position,
* and then increments the position.
@@ -128,11 +128,11 @@ final class CharBufferImpl extends CharBuffer
return backing_buffer [(pos++) + array_offset];
}
-
+
/**
* Relative put method. Writes <code>value</code> to the next position
* in the buffer.
- *
+ *
* @exception ReadOnlyBufferException If this buffer is read-only.
*/
public CharBuffer put (char value)
@@ -145,7 +145,7 @@ final class CharBufferImpl extends CharBuffer
backing_buffer [(pos++) + array_offset] = value;
return this;
}
-
+
/**
* Absolute get method. Reads the <code>char</code> at position
* <code>index</code>.
@@ -158,10 +158,10 @@ final class CharBufferImpl extends CharBuffer
public char get (int index)
{
checkIndex(index);
-
+
return backing_buffer [index + array_offset];
}
-
+
/**
* Bulk get, overloaded for speed.
*/
@@ -170,8 +170,8 @@ final class CharBufferImpl extends CharBuffer
checkArraySize(dst.length, offset, length);
checkForUnderflow(length);
- System.arraycopy(backing_buffer, pos + array_offset,
- dst, offset, length);
+ System.arraycopy(backing_buffer, pos + array_offset,
+ dst, offset, length);
pos += length;
return this;
}
@@ -183,9 +183,9 @@ final class CharBufferImpl extends CharBuffer
{
checkArraySize(src.length, offset, length);
checkForOverflow(length);
-
+
System.arraycopy(src, offset,
- backing_buffer, pos + array_offset, length);
+ backing_buffer, pos + array_offset, length);
pos += length;
return this;
}
@@ -202,11 +202,11 @@ final class CharBufferImpl extends CharBuffer
{
checkIndex(index);
checkIfReadOnly();
-
+
backing_buffer [index + array_offset] = value;
return this;
}
-
+
public ByteOrder order ()
{
return ByteOrder.nativeOrder ();
diff --git a/libjava/classpath/java/nio/CharSequenceBuffer.java b/libjava/classpath/java/nio/CharSequenceBuffer.java
index 3003670d83c..95c37cc97d6 100644
--- a/libjava/classpath/java/nio/CharSequenceBuffer.java
+++ b/libjava/classpath/java/nio/CharSequenceBuffer.java
@@ -1,4 +1,4 @@
-/* CharBuffer.java --
+/* CharBuffer.java --
Copyright (C) 2007 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -86,7 +86,7 @@ final class CharSequenceBuffer
public CharBuffer asReadOnlyBuffer()
{
return duplicate();
- }
+ }
/**
* This buffer class is not writable by definition and thus throws
diff --git a/libjava/classpath/java/nio/CharViewBufferImpl.java b/libjava/classpath/java/nio/CharViewBufferImpl.java
index 98a27a6e601..72e344d661f 100644
--- a/libjava/classpath/java/nio/CharViewBufferImpl.java
+++ b/libjava/classpath/java/nio/CharViewBufferImpl.java
@@ -1,4 +1,4 @@
-/* CharViewBufferImpl.java --
+/* CharViewBufferImpl.java --
Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,25 +45,25 @@ class CharViewBufferImpl extends CharBuffer
private final ByteBuffer bb;
private final boolean readOnly;
private final ByteOrder endian;
-
+
CharViewBufferImpl (ByteBuffer bb, int capacity)
{
super (capacity, capacity, 0, -1, bb.isDirect() ?
VMDirectByteBuffer.adjustAddress(bb.address, bb.position()) : null,
- null, 0);
+ null, 0);
this.bb = bb;
this.offset = bb.position();
this.readOnly = bb.isReadOnly();
this.endian = bb.order();
}
-
+
public CharViewBufferImpl (ByteBuffer bb, int offset, int capacity,
- int limit, int position, int mark,
- boolean readOnly, ByteOrder endian)
+ int limit, int position, int mark,
+ boolean readOnly, ByteOrder endian)
{
super (capacity, limit, position, mark, bb.isDirect() ?
VMDirectByteBuffer.adjustAddress(bb.address, offset) : null,
- null, 0);
+ null, 0);
this.bb = bb;
this.offset = offset;
this.readOnly = readOnly;
@@ -106,7 +106,7 @@ class CharViewBufferImpl extends CharBuffer
position(p + 1);
return this;
}
-
+
public CharBuffer put (int index, char value)
{
ByteBufferHelper.putChar(bb, (index << 1) + offset, value, endian);
@@ -118,26 +118,26 @@ class CharViewBufferImpl extends CharBuffer
if (position () > 0)
{
int count = limit () - position ();
- bb.shiftDown(offset, offset + 2 * position(), 2 * count);
+ bb.shiftDown(offset, offset + 2 * position(), 2 * count);
position (count);
limit (capacity ());
}
else
{
- position(limit());
- limit(capacity());
+ position(limit());
+ limit(capacity());
}
return this;
}
-
+
public CharBuffer slice ()
{
// Create a sliced copy of this object that shares its content.
return new CharViewBufferImpl (bb, (position () << 1) + offset,
- remaining (), remaining (), 0, -1,
- isReadOnly (), endian);
+ remaining (), remaining (), 0, -1,
+ isReadOnly (), endian);
}
-
+
CharBuffer duplicate (boolean readOnly)
{
int pos = position();
@@ -147,7 +147,7 @@ class CharViewBufferImpl extends CharBuffer
return new CharViewBufferImpl (bb, offset, capacity(), limit(),
pos, mark, readOnly, endian);
}
-
+
public CharBuffer duplicate ()
{
return duplicate(readOnly);
@@ -166,20 +166,20 @@ class CharViewBufferImpl extends CharBuffer
throw new IndexOutOfBoundsException ();
return new CharViewBufferImpl (bb, array_offset, capacity (),
- position () + end, position () + start,
- -1, isReadOnly (), endian);
+ position () + end, position () + start,
+ -1, isReadOnly (), endian);
}
public boolean isReadOnly ()
{
return readOnly;
}
-
+
public boolean isDirect ()
{
return bb.isDirect ();
}
-
+
public ByteOrder order ()
{
return endian;
diff --git a/libjava/classpath/java/nio/DirectByteBufferImpl.java b/libjava/classpath/java/nio/DirectByteBufferImpl.java
index 939718e9c0f..4f34732a8be 100644
--- a/libjava/classpath/java/nio/DirectByteBufferImpl.java
+++ b/libjava/classpath/java/nio/DirectByteBufferImpl.java
@@ -1,4 +1,4 @@
-/* DirectByteBufferImpl.java --
+/* DirectByteBufferImpl.java --
Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -60,8 +60,8 @@ abstract class DirectByteBufferImpl extends ByteBuffer
static final class ReadOnly extends DirectByteBufferImpl
{
ReadOnly(Object owner, Pointer address,
- int capacity, int limit,
- int position)
+ int capacity, int limit,
+ int position)
{
super(owner, address, capacity, limit, position);
}
@@ -93,10 +93,10 @@ abstract class DirectByteBufferImpl extends ByteBuffer
{
super(address, capacity);
}
-
+
ReadWrite(Object owner, Pointer address,
- int capacity, int limit,
- int position)
+ int capacity, int limit,
+ int position)
{
super(owner, address, capacity, limit, position);
}
@@ -110,7 +110,7 @@ abstract class DirectByteBufferImpl extends ByteBuffer
DirectByteBufferImpl(int capacity)
{
super(capacity, capacity, 0, -1,
- VMDirectByteBuffer.allocate(capacity), null, 0);
+ VMDirectByteBuffer.allocate(capacity), null, 0);
this.owner = this;
}
@@ -119,10 +119,10 @@ abstract class DirectByteBufferImpl extends ByteBuffer
super(capacity, capacity, 0, -1, address, null, 0);
this.owner = null;
}
-
+
DirectByteBufferImpl(Object owner, Pointer address,
- int capacity, int limit,
- int position)
+ int capacity, int limit,
+ int position)
{
super(capacity, limit, position, -1, address, null, 0);
this.owner = owner;
@@ -130,7 +130,7 @@ abstract class DirectByteBufferImpl extends ByteBuffer
/**
* Allocates a new direct byte buffer.
- */
+ */
public static ByteBuffer allocate(int capacity)
{
return new DirectByteBufferImpl.ReadWrite(capacity);
@@ -141,7 +141,7 @@ abstract class DirectByteBufferImpl extends ByteBuffer
if (owner == this)
VMDirectByteBuffer.free(address);
}
-
+
public byte get()
{
checkForUnderflow();
@@ -180,7 +180,7 @@ abstract class DirectByteBufferImpl extends ByteBuffer
position(pos + 1);
return this;
}
-
+
public ByteBuffer put(int index, byte value)
{
checkIndex(index);
@@ -188,7 +188,7 @@ abstract class DirectByteBufferImpl extends ByteBuffer
VMDirectByteBuffer.put(address, index, value);
return this;
}
-
+
public ByteBuffer put (byte[] src, int offset, int length)
{
checkArraySize (src.length, offset, length);
@@ -196,15 +196,15 @@ abstract class DirectByteBufferImpl extends ByteBuffer
int index = position ();
VMDirectByteBuffer.put (address, index, src, offset, length);
position (index + length);
-
+
return this;
}
-
+
void shiftDown(int dst_offset, int src_offset, int count)
{
VMDirectByteBuffer.shiftDown(address, dst_offset, src_offset, count);
}
-
+
public ByteBuffer compact()
{
checkIfReadOnly();
@@ -212,15 +212,15 @@ abstract class DirectByteBufferImpl extends ByteBuffer
int pos = position();
if (pos > 0)
{
- int count = remaining();
- VMDirectByteBuffer.shiftDown(address, 0, pos, count);
- position(count);
- limit(capacity());
+ int count = remaining();
+ VMDirectByteBuffer.shiftDown(address, 0, pos, count);
+ position(count);
+ limit(capacity());
}
else
{
- position(limit());
- limit(capacity());
+ position(limit());
+ limit(capacity());
}
return this;
}
@@ -255,9 +255,9 @@ abstract class DirectByteBufferImpl extends ByteBuffer
if (mark != pos)
{
- result.position(mark);
- result.mark();
- result.position(pos);
+ result.position(mark);
+ result.mark();
+ result.position(pos);
}
return result;
}
@@ -311,18 +311,18 @@ abstract class DirectByteBufferImpl extends ByteBuffer
{
return ByteBufferHelper.getChar(this, order());
}
-
+
public ByteBuffer putChar(char value)
{
ByteBufferHelper.putChar(this, value, order());
return this;
}
-
+
public char getChar(int index)
{
return ByteBufferHelper.getChar(this, index, order());
}
-
+
public ByteBuffer putChar(int index, char value)
{
ByteBufferHelper.putChar(this, index, value, order());
@@ -333,18 +333,18 @@ abstract class DirectByteBufferImpl extends ByteBuffer
{
return ByteBufferHelper.getShort(this, order());
}
-
+
public ByteBuffer putShort(short value)
{
ByteBufferHelper.putShort(this, value, order());
return this;
}
-
+
public short getShort(int index)
{
return ByteBufferHelper.getShort(this, index, order());
}
-
+
public ByteBuffer putShort(int index, short value)
{
ByteBufferHelper.putShort(this, index, value, order());
@@ -355,18 +355,18 @@ abstract class DirectByteBufferImpl extends ByteBuffer
{
return ByteBufferHelper.getInt(this, order());
}
-
+
public ByteBuffer putInt(int value)
{
ByteBufferHelper.putInt(this, value, order());
return this;
}
-
+
public int getInt(int index)
{
return ByteBufferHelper.getInt(this, index, order());
}
-
+
public ByteBuffer putInt(int index, int value)
{
ByteBufferHelper.putInt(this, index, value, order());
@@ -377,18 +377,18 @@ abstract class DirectByteBufferImpl extends ByteBuffer
{
return ByteBufferHelper.getLong(this, order());
}
-
+
public ByteBuffer putLong(long value)
{
ByteBufferHelper.putLong(this, value, order());
return this;
}
-
+
public long getLong(int index)
{
return ByteBufferHelper.getLong(this, index, order());
}
-
+
public ByteBuffer putLong(int index, long value)
{
ByteBufferHelper.putLong(this, index, value, order());
@@ -399,13 +399,13 @@ abstract class DirectByteBufferImpl extends ByteBuffer
{
return ByteBufferHelper.getFloat(this, order());
}
-
+
public ByteBuffer putFloat(float value)
{
ByteBufferHelper.putFloat(this, value, order());
return this;
}
-
+
public float getFloat(int index)
{
return ByteBufferHelper.getFloat(this, index, order());
@@ -427,12 +427,12 @@ abstract class DirectByteBufferImpl extends ByteBuffer
ByteBufferHelper.putDouble(this, value, order());
return this;
}
-
+
public double getDouble(int index)
{
return ByteBufferHelper.getDouble(this, index, order());
}
-
+
public ByteBuffer putDouble(int index, double value)
{
ByteBufferHelper.putDouble(this, index, value, order());
diff --git a/libjava/classpath/java/nio/DoubleBuffer.java b/libjava/classpath/java/nio/DoubleBuffer.java
index 1a51f1889be..c17058c44a8 100644
--- a/libjava/classpath/java/nio/DoubleBuffer.java
+++ b/libjava/classpath/java/nio/DoubleBuffer.java
@@ -1,4 +1,4 @@
-/* DoubleBuffer.java --
+/* DoubleBuffer.java --
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -51,7 +51,7 @@ public abstract class DoubleBuffer extends Buffer
final double[] backing_buffer;
DoubleBuffer (int capacity, int limit, int position, int mark,
- RawData address, double[] backing_buffer, int array_offset)
+ RawData address, double[] backing_buffer, int array_offset)
{
super (capacity, limit, position, mark, address);
this.backing_buffer = backing_buffer;
@@ -86,11 +86,11 @@ public abstract class DoubleBuffer extends Buffer
{
return wrap (array, 0, array.length);
}
-
+
/**
* This method transfers <code>double</code>s from this buffer into the given
* destination array. Before the transfer, it checks if there are fewer than
- * length <code>double</code>s remaining in this buffer.
+ * length <code>double</code>s remaining in this buffer.
*
* @param dst The destination array
* @param offset The offset within the array of the first <code>double</code>
@@ -169,7 +169,7 @@ public abstract class DoubleBuffer extends Buffer
* must be non-negative and no larger than src.length.
* @param length The number of bytes to be read from the given array;
* must be non-negative and no larger than src.length - offset.
- *
+ *
* @exception BufferOverflowException If there is insufficient space in this
* buffer for the remaining <code>double</code>s in the source array.
* @exception IndexOutOfBoundsException If the preconditions on the offset
@@ -192,7 +192,7 @@ public abstract class DoubleBuffer extends Buffer
* into the buffer.
*
* @param src The array to copy into the buffer.
- *
+ *
* @exception BufferOverflowException If there is insufficient space in this
* buffer for the remaining <code>double</code>s in the source array.
* @exception ReadOnlyBufferException If this buffer is read-only.
@@ -225,7 +225,7 @@ public abstract class DoubleBuffer extends Buffer
throw new UnsupportedOperationException ();
checkIfReadOnly();
-
+
return backing_buffer;
}
@@ -242,7 +242,7 @@ public abstract class DoubleBuffer extends Buffer
throw new UnsupportedOperationException ();
checkIfReadOnly();
-
+
return array_offset;
}
@@ -254,7 +254,7 @@ public abstract class DoubleBuffer extends Buffer
* <code>s[position()] + 31 + (s[position()+1] + 30)*31**1 + ... +
* (s[limit()-1]+30)*31**(limit()-1)</code>.
* Where s is the buffer data, in Double.doubleToLongBits() form
- * Note that the hashcode is dependent on buffer content,
+ * Note that the hashcode is dependent on buffer content,
* and therefore is not useful if the buffer content may change.
*
* @return the hash code (casted to int)
@@ -265,8 +265,8 @@ public abstract class DoubleBuffer extends Buffer
long multiplier = 1;
for (int i = position() + 1; i < limit(); ++i)
{
- multiplier *= 31;
- hashCode += (Double.doubleToLongBits(get(i)) + 30)*multiplier;
+ multiplier *= 31;
+ hashCode += (Double.doubleToLongBits(get(i)) + 30)*multiplier;
}
return ((int)hashCode);
}
@@ -295,21 +295,21 @@ public abstract class DoubleBuffer extends Buffer
int num = Math.min(remaining(), other.remaining());
int pos_this = position();
int pos_other = other.position();
-
+
for (int count = 0; count < num; count++)
{
- double a = get(pos_this++);
- double b = other.get(pos_other++);
-
- if (a == b)
- continue;
-
- if (a < b)
- return -1;
-
- return 1;
+ double a = get(pos_this++);
+ double b = other.get(pos_other++);
+
+ if (a == b)
+ continue;
+
+ if (a < b)
+ return -1;
+
+ return 1;
}
-
+
return remaining() - other.remaining();
}
@@ -331,7 +331,7 @@ public abstract class DoubleBuffer extends Buffer
* Writes the <code>double</code> at this buffer's current position,
* and then increments the position.
*
- * @exception BufferOverflowException If there no remaining
+ * @exception BufferOverflowException If there no remaining
* <code>double</code>s in this buffer.
* @exception ReadOnlyBufferException If this buffer is read-only.
*/
@@ -344,7 +344,7 @@ public abstract class DoubleBuffer extends Buffer
* than the buffer's limit.
*/
public abstract double get (int index);
-
+
/**
* Absolute put method.
*
@@ -356,7 +356,7 @@ public abstract class DoubleBuffer extends Buffer
/**
* Compacts this buffer.
- *
+ *
* @exception ReadOnlyBufferException If this buffer is read-only.
*/
public abstract DoubleBuffer compact ();
diff --git a/libjava/classpath/java/nio/DoubleBufferImpl.java b/libjava/classpath/java/nio/DoubleBufferImpl.java
index bc292df646d..1608413535a 100644
--- a/libjava/classpath/java/nio/DoubleBufferImpl.java
+++ b/libjava/classpath/java/nio/DoubleBufferImpl.java
@@ -1,4 +1,4 @@
-/* DoubleBufferImpl.java --
+/* DoubleBufferImpl.java --
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -49,37 +49,37 @@ final class DoubleBufferImpl extends DoubleBuffer
{
this (new double [capacity], 0, capacity, capacity, 0, -1, false);
}
-
+
DoubleBufferImpl (double[] buffer, int offset, int capacity, int limit,
- int position, int mark, boolean readOnly)
+ int position, int mark, boolean readOnly)
{
super (capacity, limit, position, mark, null, buffer, offset);
this.readOnly = readOnly;
}
-
+
public boolean isReadOnly ()
{
return readOnly;
}
-
+
public DoubleBuffer slice ()
{
return new DoubleBufferImpl (backing_buffer, array_offset + position (),
- remaining (), remaining (), 0, -1, isReadOnly ());
+ remaining (), remaining (), 0, -1, isReadOnly ());
}
-
+
public DoubleBuffer duplicate ()
{
return new DoubleBufferImpl (backing_buffer, array_offset, capacity (),
- limit (), position (), mark, isReadOnly ());
+ limit (), position (), mark, isReadOnly ());
}
-
+
public DoubleBuffer asReadOnlyBuffer ()
{
return new DoubleBufferImpl (backing_buffer, array_offset, capacity (),
- limit (), position (), mark, true);
+ limit (), position (), mark, true);
}
-
+
public DoubleBuffer compact ()
{
checkIfReadOnly();
@@ -95,7 +95,7 @@ final class DoubleBufferImpl extends DoubleBuffer
limit(capacity());
return this;
}
-
+
public boolean isDirect ()
{
return false;
@@ -116,12 +116,12 @@ final class DoubleBufferImpl extends DoubleBuffer
position (position () + 1);
return result;
}
-
+
/**
* Relative put method. Writes <code>value</code> to the next position
* in the buffer.
*
- * @exception BufferOverflowException If there no remaining
+ * @exception BufferOverflowException If there no remaining
* space in this buffer.
* @exception ReadOnlyBufferException If this buffer is read-only.
*/
@@ -129,12 +129,12 @@ final class DoubleBufferImpl extends DoubleBuffer
{
checkIfReadOnly();
checkForOverflow();
-
+
backing_buffer [position ()] = value;
position (position () + 1);
return this;
}
-
+
/**
* Absolute get method. Reads the <code>double</code> at position
* <code>index</code>.
@@ -148,7 +148,7 @@ final class DoubleBufferImpl extends DoubleBuffer
return backing_buffer [index];
}
-
+
/**
* Absolute put method. Writes <code>value</code> to position
* <code>index</code> in the buffer.
@@ -165,7 +165,7 @@ final class DoubleBufferImpl extends DoubleBuffer
backing_buffer [index] = value;
return this;
}
-
+
public ByteOrder order ()
{
return ByteOrder.nativeOrder ();
diff --git a/libjava/classpath/java/nio/DoubleViewBufferImpl.java b/libjava/classpath/java/nio/DoubleViewBufferImpl.java
index d82fa92c4a7..a78bf273878 100644
--- a/libjava/classpath/java/nio/DoubleViewBufferImpl.java
+++ b/libjava/classpath/java/nio/DoubleViewBufferImpl.java
@@ -1,4 +1,4 @@
-/* DoubleViewBufferImpl.java --
+/* DoubleViewBufferImpl.java --
Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ final class DoubleViewBufferImpl extends DoubleBuffer
private final ByteBuffer bb;
private final boolean readOnly;
private final ByteOrder endian;
-
+
DoubleViewBufferImpl (ByteBuffer bb, int capacity)
{
super (capacity, capacity, 0, -1, bb.isDirect() ?
@@ -55,7 +55,7 @@ final class DoubleViewBufferImpl extends DoubleBuffer
this.readOnly = bb.isReadOnly();
this.endian = bb.order();
}
-
+
public DoubleViewBufferImpl (ByteBuffer bb, int offset, int capacity,
int limit, int position, int mark,
boolean readOnly, ByteOrder endian)
@@ -102,7 +102,7 @@ final class DoubleViewBufferImpl extends DoubleBuffer
position(p + 1);
return this;
}
-
+
public DoubleBuffer put (int index, double value)
{
ByteBufferHelper.putDouble(bb, (index << 3) + offset, value, endian);
@@ -114,25 +114,25 @@ final class DoubleViewBufferImpl extends DoubleBuffer
if (position () > 0)
{
int count = limit () - position ();
- bb.shiftDown(offset, offset + 8 * position(), 8 * count);
+ bb.shiftDown(offset, offset + 8 * position(), 8 * count);
position (count);
limit (capacity ());
}
else
{
- position(limit());
- limit(capacity());
+ position(limit());
+ limit(capacity());
}
return this;
}
-
+
public DoubleBuffer slice ()
{
return new DoubleViewBufferImpl (bb, (position () << 3) + offset,
- remaining(), remaining(), 0, -1,
+ remaining(), remaining(), 0, -1,
readOnly, endian);
}
-
+
DoubleBuffer duplicate (boolean readOnly)
{
int pos = position();
@@ -142,7 +142,7 @@ final class DoubleViewBufferImpl extends DoubleBuffer
return new DoubleViewBufferImpl (bb, offset, capacity(), limit(),
pos, mark, readOnly, endian);
}
-
+
public DoubleBuffer duplicate ()
{
return duplicate(readOnly);
@@ -157,12 +157,12 @@ final class DoubleViewBufferImpl extends DoubleBuffer
{
return readOnly;
}
-
+
public boolean isDirect ()
{
return bb.isDirect ();
}
-
+
public ByteOrder order ()
{
return endian;
diff --git a/libjava/classpath/java/nio/FloatBuffer.java b/libjava/classpath/java/nio/FloatBuffer.java
index ce40a09e37b..3459cf12b22 100644
--- a/libjava/classpath/java/nio/FloatBuffer.java
+++ b/libjava/classpath/java/nio/FloatBuffer.java
@@ -1,4 +1,4 @@
-/* FloatBuffer.java --
+/* FloatBuffer.java --
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -51,7 +51,7 @@ public abstract class FloatBuffer extends Buffer
final float[] backing_buffer;
FloatBuffer (int capacity, int limit, int position, int mark,
- RawData address, float[] backing_buffer, int array_offset)
+ RawData address, float[] backing_buffer, int array_offset)
{
super (capacity, limit, position, mark, address);
this.backing_buffer = backing_buffer;
@@ -86,11 +86,11 @@ public abstract class FloatBuffer extends Buffer
{
return wrap (array, 0, array.length);
}
-
+
/**
* This method transfers <code>float</code>s from this buffer into the given
* destination array. Before the transfer, it checks if there are fewer than
- * length <code>float</code>s remaining in this buffer.
+ * length <code>float</code>s remaining in this buffer.
*
* @param dst The destination array
* @param offset The offset within the array of the first <code>float</code>
@@ -169,7 +169,7 @@ public abstract class FloatBuffer extends Buffer
* must be non-negative and no larger than src.length.
* @param length The number of bytes to be read from the given array;
* must be non-negative and no larger than src.length - offset.
- *
+ *
* @exception BufferOverflowException If there is insufficient space in this
* buffer for the remaining <code>float</code>s in the source array.
* @exception IndexOutOfBoundsException If the preconditions on the offset
@@ -192,7 +192,7 @@ public abstract class FloatBuffer extends Buffer
* into the buffer.
*
* @param src The array to copy into the buffer.
- *
+ *
* @exception BufferOverflowException If there is insufficient space in this
* buffer for the remaining <code>float</code>s in the source array.
* @exception ReadOnlyBufferException If this buffer is read-only.
@@ -225,7 +225,7 @@ public abstract class FloatBuffer extends Buffer
throw new UnsupportedOperationException ();
checkIfReadOnly();
-
+
return backing_buffer;
}
@@ -242,7 +242,7 @@ public abstract class FloatBuffer extends Buffer
throw new UnsupportedOperationException ();
checkIfReadOnly();
-
+
return array_offset;
}
@@ -254,7 +254,7 @@ public abstract class FloatBuffer extends Buffer
* <code>s[position()] + 31 + (s[position()+1] + 30)*31**1 + ... +
* (s[limit()-1]+30)*31**(limit()-1)</code>.
* Where s is the buffer data, in Float.floatToIntBits() form
- * Note that the hashcode is dependent on buffer content,
+ * Note that the hashcode is dependent on buffer content,
* and therefore is not useful if the buffer content may change.
*
* @return the hash code
@@ -265,8 +265,8 @@ public abstract class FloatBuffer extends Buffer
int multiplier = 1;
for (int i = position() + 1; i < limit(); ++i)
{
- multiplier *= 31;
- hashCode += (Float.floatToIntBits(get(i)) + 30)*multiplier;
+ multiplier *= 31;
+ hashCode += (Float.floatToIntBits(get(i)) + 30)*multiplier;
}
return hashCode;
}
@@ -295,21 +295,21 @@ public abstract class FloatBuffer extends Buffer
int num = Math.min(remaining(), other.remaining());
int pos_this = position();
int pos_other = other.position();
-
+
for (int count = 0; count < num; count++)
{
- float a = get(pos_this++);
- float b = other.get(pos_other++);
-
- if (a == b)
- continue;
-
- if (a < b)
- return -1;
-
- return 1;
+ float a = get(pos_this++);
+ float b = other.get(pos_other++);
+
+ if (a == b)
+ continue;
+
+ if (a < b)
+ return -1;
+
+ return 1;
}
-
+
return remaining() - other.remaining();
}
@@ -331,7 +331,7 @@ public abstract class FloatBuffer extends Buffer
* Writes the <code>float</code> at this buffer's current position,
* and then increments the position.
*
- * @exception BufferOverflowException If there no remaining
+ * @exception BufferOverflowException If there no remaining
* <code>float</code>s in this buffer.
* @exception ReadOnlyBufferException If this buffer is read-only.
*/
@@ -344,7 +344,7 @@ public abstract class FloatBuffer extends Buffer
* than the buffer's limit.
*/
public abstract float get (int index);
-
+
/**
* Absolute put method.
*
@@ -356,7 +356,7 @@ public abstract class FloatBuffer extends Buffer
/**
* Compacts this buffer.
- *
+ *
* @exception ReadOnlyBufferException If this buffer is read-only.
*/
public abstract FloatBuffer compact ();
diff --git a/libjava/classpath/java/nio/FloatBufferImpl.java b/libjava/classpath/java/nio/FloatBufferImpl.java
index 5d0e7ca8590..603832d7a49 100644
--- a/libjava/classpath/java/nio/FloatBufferImpl.java
+++ b/libjava/classpath/java/nio/FloatBufferImpl.java
@@ -1,4 +1,4 @@
-/* FloatBufferImpl.java --
+/* FloatBufferImpl.java --
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -49,34 +49,34 @@ final class FloatBufferImpl extends FloatBuffer
{
this (new float [capacity], 0, capacity, capacity, 0, -1, false);
}
-
+
FloatBufferImpl (float[] buffer, int offset, int capacity, int limit,
- int position, int mark, boolean readOnly)
+ int position, int mark, boolean readOnly)
{
super (capacity, limit, position, mark, null, buffer, offset);
this.readOnly = readOnly;
}
-
+
public boolean isReadOnly ()
{
return readOnly;
}
-
+
public FloatBuffer slice ()
{
return new FloatBufferImpl (backing_buffer, array_offset + position (), remaining (), remaining (), 0, -1, isReadOnly ());
}
-
+
public FloatBuffer duplicate ()
{
return new FloatBufferImpl (backing_buffer, array_offset, capacity (), limit (), position (), mark, isReadOnly ());
}
-
+
public FloatBuffer asReadOnlyBuffer ()
{
return new FloatBufferImpl (backing_buffer, array_offset, capacity (), limit (), position (), mark, true);
}
-
+
public FloatBuffer compact ()
{
checkIfReadOnly();
@@ -92,7 +92,7 @@ final class FloatBufferImpl extends FloatBuffer
limit(capacity());
return this;
}
-
+
public boolean isDirect ()
{
return false;
@@ -113,12 +113,12 @@ final class FloatBufferImpl extends FloatBuffer
position (position () + 1);
return result;
}
-
+
/**
* Relative put method. Writes <code>value</code> to the next position
* in the buffer.
- *
- * @exception BufferOverflowException If there no remaining
+ *
+ * @exception BufferOverflowException If there no remaining
* space in this buffer.
* @exception ReadOnlyBufferException If this buffer is read-only.
*/
@@ -131,7 +131,7 @@ final class FloatBufferImpl extends FloatBuffer
position (position () + 1);
return this;
}
-
+
/**
* Absolute get method. Reads the <code>float</code> at position
* <code>index</code>.
@@ -145,7 +145,7 @@ final class FloatBufferImpl extends FloatBuffer
return backing_buffer [index];
}
-
+
/**
* Absolute put method. Writes <code>value</code> to position
* <code>index</code> in the buffer.
@@ -162,7 +162,7 @@ final class FloatBufferImpl extends FloatBuffer
backing_buffer [index] = value;
return this;
}
-
+
public ByteOrder order ()
{
return ByteOrder.nativeOrder ();
diff --git a/libjava/classpath/java/nio/FloatViewBufferImpl.java b/libjava/classpath/java/nio/FloatViewBufferImpl.java
index 9f10d824fe0..663b65c4e3a 100644
--- a/libjava/classpath/java/nio/FloatViewBufferImpl.java
+++ b/libjava/classpath/java/nio/FloatViewBufferImpl.java
@@ -1,4 +1,4 @@
-/* FloatViewBufferImpl.java --
+/* FloatViewBufferImpl.java --
Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ final class FloatViewBufferImpl extends FloatBuffer
private final ByteBuffer bb;
private final boolean readOnly;
private final ByteOrder endian;
-
+
FloatViewBufferImpl (ByteBuffer bb, int capacity)
{
super (capacity, capacity, 0, -1, bb.isDirect() ?
@@ -55,10 +55,10 @@ final class FloatViewBufferImpl extends FloatBuffer
this.readOnly = bb.isReadOnly();
this.endian = bb.order();
}
-
+
public FloatViewBufferImpl (ByteBuffer bb, int offset, int capacity,
- int limit, int position, int mark,
- boolean readOnly, ByteOrder endian)
+ int limit, int position, int mark,
+ boolean readOnly, ByteOrder endian)
{
super (capacity, limit, position, mark, bb.isDirect() ?
VMDirectByteBuffer.adjustAddress(bb.address, offset):null, null, 0);
@@ -102,7 +102,7 @@ final class FloatViewBufferImpl extends FloatBuffer
position(p + 1);
return this;
}
-
+
public FloatBuffer put (int index, float value)
{
ByteBufferHelper.putFloat(bb, (index << 2) + offset, value, endian);
@@ -114,26 +114,26 @@ final class FloatViewBufferImpl extends FloatBuffer
if (position () > 0)
{
int count = limit () - position ();
- bb.shiftDown(offset, offset + 4 * position(), 4 * count);
+ bb.shiftDown(offset, offset + 4 * position(), 4 * count);
position (count);
limit (capacity ());
}
else
{
- position(limit());
- limit(capacity());
+ position(limit());
+ limit(capacity());
}
return this;
}
-
+
public FloatBuffer slice ()
{
// Create a sliced copy of this object that shares its content.
return new FloatViewBufferImpl (bb, (position () << 2) + offset,
- remaining(), remaining(), 0, -1,
- readOnly, endian);
+ remaining(), remaining(), 0, -1,
+ readOnly, endian);
}
-
+
FloatBuffer duplicate (boolean readOnly)
{
int pos = position();
@@ -141,9 +141,9 @@ final class FloatViewBufferImpl extends FloatBuffer
int mark = position();
position(pos);
return new FloatViewBufferImpl (bb, offset, capacity(), limit(),
- pos, mark, readOnly, endian);
+ pos, mark, readOnly, endian);
}
-
+
public FloatBuffer duplicate ()
{
return duplicate(readOnly);
@@ -158,12 +158,12 @@ final class FloatViewBufferImpl extends FloatBuffer
{
return readOnly;
}
-
+
public boolean isDirect ()
{
return bb.isDirect ();
}
-
+
public ByteOrder order ()
{
return endian;
diff --git a/libjava/classpath/java/nio/IntBuffer.java b/libjava/classpath/java/nio/IntBuffer.java
index dd50be84611..597886d9a26 100644
--- a/libjava/classpath/java/nio/IntBuffer.java
+++ b/libjava/classpath/java/nio/IntBuffer.java
@@ -1,4 +1,4 @@
-/* IntBuffer.java --
+/* IntBuffer.java --
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -51,7 +51,7 @@ public abstract class IntBuffer extends Buffer
final int[] backing_buffer;
IntBuffer (int capacity, int limit, int position, int mark,
- RawData address, int[] backing_buffer, int array_offset)
+ RawData address, int[] backing_buffer, int array_offset)
{
super (capacity, limit, position, mark, address);
this.backing_buffer = backing_buffer;
@@ -76,7 +76,7 @@ public abstract class IntBuffer extends Buffer
public static final IntBuffer wrap (int[] array, int offset, int length)
{
return new IntBufferImpl (array, 0, array.length, offset + length, offset,
- -1, false);
+ -1, false);
}
/**
@@ -87,11 +87,11 @@ public abstract class IntBuffer extends Buffer
{
return wrap (array, 0, array.length);
}
-
+
/**
* This method transfers <code>int</code>s from this buffer into the given
* destination array. Before the transfer, it checks if there are fewer than
- * length <code>int</code>s remaining in this buffer.
+ * length <code>int</code>s remaining in this buffer.
*
* @param dst The destination array
* @param offset The offset within the array of the first <code>int</code>
@@ -170,7 +170,7 @@ public abstract class IntBuffer extends Buffer
* must be non-negative and no larger than src.length.
* @param length The number of bytes to be read from the given array;
* must be non-negative and no larger than src.length - offset.
- *
+ *
* @exception BufferOverflowException If there is insufficient space in this
* buffer for the remaining <code>int</code>s in the source array.
* @exception IndexOutOfBoundsException If the preconditions on the offset
@@ -193,7 +193,7 @@ public abstract class IntBuffer extends Buffer
* into the buffer.
*
* @param src The array to copy into the buffer.
- *
+ *
* @exception BufferOverflowException If there is insufficient space in this
* buffer for the remaining <code>int</code>s in the source array.
* @exception ReadOnlyBufferException If this buffer is read-only.
@@ -226,7 +226,7 @@ public abstract class IntBuffer extends Buffer
throw new UnsupportedOperationException ();
checkIfReadOnly();
-
+
return backing_buffer;
}
@@ -243,7 +243,7 @@ public abstract class IntBuffer extends Buffer
throw new UnsupportedOperationException ();
checkIfReadOnly();
-
+
return array_offset;
}
@@ -266,8 +266,8 @@ public abstract class IntBuffer extends Buffer
int multiplier = 1;
for (int i = position() + 1; i < limit(); ++i)
{
- multiplier *= 31;
- hashCode += (get(i) + 30)*multiplier;
+ multiplier *= 31;
+ hashCode += (get(i) + 30)*multiplier;
}
return hashCode;
}
@@ -296,21 +296,21 @@ public abstract class IntBuffer extends Buffer
int num = Math.min(remaining(), other.remaining());
int pos_this = position();
int pos_other = other.position();
-
+
for (int count = 0; count < num; count++)
{
- int a = get(pos_this++);
- int b = other.get(pos_other++);
-
- if (a == b)
- continue;
-
- if (a < b)
- return -1;
-
- return 1;
+ int a = get(pos_this++);
+ int b = other.get(pos_other++);
+
+ if (a == b)
+ continue;
+
+ if (a < b)
+ return -1;
+
+ return 1;
}
-
+
return remaining() - other.remaining();
}
@@ -332,7 +332,7 @@ public abstract class IntBuffer extends Buffer
* Writes the <code>int</code> at this buffer's current position,
* and then increments the position.
*
- * @exception BufferOverflowException If there no remaining
+ * @exception BufferOverflowException If there no remaining
* <code>int</code>s in this buffer.
* @exception ReadOnlyBufferException If this buffer is read-only.
*/
@@ -345,7 +345,7 @@ public abstract class IntBuffer extends Buffer
* than the buffer's limit.
*/
public abstract int get (int index);
-
+
/**
* Absolute put method.
*
@@ -357,7 +357,7 @@ public abstract class IntBuffer extends Buffer
/**
* Compacts this buffer.
- *
+ *
* @exception ReadOnlyBufferException If this buffer is read-only.
*/
public abstract IntBuffer compact ();
diff --git a/libjava/classpath/java/nio/IntBufferImpl.java b/libjava/classpath/java/nio/IntBufferImpl.java
index c332715fbda..1b31b079523 100644
--- a/libjava/classpath/java/nio/IntBufferImpl.java
+++ b/libjava/classpath/java/nio/IntBufferImpl.java
@@ -1,4 +1,4 @@
-/* IntBufferImpl.java --
+/* IntBufferImpl.java --
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -49,33 +49,33 @@ final class IntBufferImpl extends IntBuffer
{
this (new int [capacity], 0, capacity, capacity, 0, -1, false);
}
-
+
IntBufferImpl (int[] buffer, int offset, int capacity, int limit, int position, int mark, boolean readOnly)
{
super (capacity, limit, position, mark, null, buffer, offset);
this.readOnly = readOnly;
}
-
+
public boolean isReadOnly ()
{
return readOnly;
}
-
+
public IntBuffer slice ()
{
return new IntBufferImpl (backing_buffer, array_offset + position (), remaining (), remaining (), 0, -1, isReadOnly ());
}
-
+
public IntBuffer duplicate ()
{
return new IntBufferImpl (backing_buffer, array_offset, capacity (), limit (), position (), mark, isReadOnly ());
}
-
+
public IntBuffer asReadOnlyBuffer ()
{
return new IntBufferImpl (backing_buffer, array_offset, capacity (), limit (), position (), mark, true);
}
-
+
public IntBuffer compact ()
{
checkIfReadOnly();
@@ -91,7 +91,7 @@ final class IntBufferImpl extends IntBuffer
limit(capacity());
return this;
}
-
+
public boolean isDirect ()
{
return false;
@@ -112,12 +112,12 @@ final class IntBufferImpl extends IntBuffer
position (position () + 1);
return result;
}
-
+
/**
* Relative put method. Writes <code>value</code> to the next position
* in the buffer.
*
- * @exception BufferOverflowException If there no remaining
+ * @exception BufferOverflowException If there no remaining
* space in this buffer.
* @exception ReadOnlyBufferException If this buffer is read-only.
*/
@@ -130,7 +130,7 @@ final class IntBufferImpl extends IntBuffer
position (position () + 1);
return this;
}
-
+
/**
* Absolute get method. Reads the <code>int</code> at position
* <code>index</code>.
@@ -144,7 +144,7 @@ final class IntBufferImpl extends IntBuffer
return backing_buffer [index];
}
-
+
/**
* Absolute put method. Writes <code>value</code> to position
* <code>index</code> in the buffer.
@@ -161,7 +161,7 @@ final class IntBufferImpl extends IntBuffer
backing_buffer [index] = value;
return this;
}
-
+
public ByteOrder order ()
{
return ByteOrder.nativeOrder ();
diff --git a/libjava/classpath/java/nio/IntViewBufferImpl.java b/libjava/classpath/java/nio/IntViewBufferImpl.java
index 9af5d58a4dc..dd3d6941aa2 100644
--- a/libjava/classpath/java/nio/IntViewBufferImpl.java
+++ b/libjava/classpath/java/nio/IntViewBufferImpl.java
@@ -1,4 +1,4 @@
-/* IntViewBufferImpl.java --
+/* IntViewBufferImpl.java --
Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ final class IntViewBufferImpl extends IntBuffer
private final ByteBuffer bb;
private final boolean readOnly;
private final ByteOrder endian;
-
+
IntViewBufferImpl (ByteBuffer bb, int capacity)
{
super (capacity, capacity, 0, -1, bb.isDirect() ?
@@ -55,10 +55,10 @@ final class IntViewBufferImpl extends IntBuffer
this.readOnly = bb.isReadOnly();
this.endian = bb.order();
}
-
+
public IntViewBufferImpl (ByteBuffer bb, int offset, int capacity,
- int limit, int position, int mark,
- boolean readOnly, ByteOrder endian)
+ int limit, int position, int mark,
+ boolean readOnly, ByteOrder endian)
{
super (capacity, limit, position, mark, bb.isDirect() ?
VMDirectByteBuffer.adjustAddress(bb.address, offset):null, null, 0);
@@ -102,7 +102,7 @@ final class IntViewBufferImpl extends IntBuffer
position(p + 1);
return this;
}
-
+
public IntBuffer put (int index, int value)
{
ByteBufferHelper.putInt(bb, (index << 2) + offset, value, endian);
@@ -114,26 +114,26 @@ final class IntViewBufferImpl extends IntBuffer
if (position () > 0)
{
int count = limit () - position ();
- bb.shiftDown(offset, offset + 4 * position(), 4 * count);
+ bb.shiftDown(offset, offset + 4 * position(), 4 * count);
position (count);
limit (capacity ());
}
else
{
- position(limit());
- limit(capacity());
+ position(limit());
+ limit(capacity());
}
return this;
}
-
+
public IntBuffer slice ()
{
// Create a sliced copy of this object that shares its content.
return new IntViewBufferImpl (bb, (position () << 2) + offset,
- remaining(), remaining(), 0, -1,
- readOnly, endian);
+ remaining(), remaining(), 0, -1,
+ readOnly, endian);
}
-
+
IntBuffer duplicate (boolean readOnly)
{
int pos = position();
@@ -141,9 +141,9 @@ final class IntViewBufferImpl extends IntBuffer
int mark = position();
position(pos);
return new IntViewBufferImpl (bb, offset, capacity(), limit(),
- pos, mark, readOnly, endian);
+ pos, mark, readOnly, endian);
}
-
+
public IntBuffer duplicate ()
{
return duplicate(readOnly);
@@ -158,12 +158,12 @@ final class IntViewBufferImpl extends IntBuffer
{
return readOnly;
}
-
+
public boolean isDirect ()
{
return bb.isDirect ();
}
-
+
public ByteOrder order ()
{
return endian;
diff --git a/libjava/classpath/java/nio/InvalidMarkException.java b/libjava/classpath/java/nio/InvalidMarkException.java
index 013f02f79f2..e13d76f1f3f 100644
--- a/libjava/classpath/java/nio/InvalidMarkException.java
+++ b/libjava/classpath/java/nio/InvalidMarkException.java
@@ -1,4 +1,4 @@
-/* InvalidMarkException.java --
+/* InvalidMarkException.java --
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
diff --git a/libjava/classpath/java/nio/LongBuffer.java b/libjava/classpath/java/nio/LongBuffer.java
index 1195cc88ce2..b6e94e8a8d2 100644
--- a/libjava/classpath/java/nio/LongBuffer.java
+++ b/libjava/classpath/java/nio/LongBuffer.java
@@ -1,4 +1,4 @@
-/* LongBuffer.java --
+/* LongBuffer.java --
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -51,7 +51,7 @@ public abstract class LongBuffer extends Buffer
final long[] backing_buffer;
LongBuffer (int capacity, int limit, int position, int mark,
- RawData address, long[] backing_buffer, int array_offset)
+ RawData address, long[] backing_buffer, int array_offset)
{
super (capacity, limit, position, mark, address);
this.backing_buffer = backing_buffer;
@@ -86,11 +86,11 @@ public abstract class LongBuffer extends Buffer
{
return wrap (array, 0, array.length);
}
-
+
/**
* This method transfers <code>long</code>s from this buffer into the given
* destination array. Before the transfer, it checks if there are fewer than
- * length <code>long</code>s remaining in this buffer.
+ * length <code>long</code>s remaining in this buffer.
*
* @param dst The destination array
* @param offset The offset within the array of the first <code>long</code>
@@ -169,7 +169,7 @@ public abstract class LongBuffer extends Buffer
* must be non-negative and no larger than src.length.
* @param length The number of bytes to be read from the given array;
* must be non-negative and no larger than src.length - offset.
- *
+ *
* @exception BufferOverflowException If there is insufficient space in this
* buffer for the remaining <code>long</code>s in the source array.
* @exception IndexOutOfBoundsException If the preconditions on the offset
@@ -192,7 +192,7 @@ public abstract class LongBuffer extends Buffer
* into the buffer.
*
* @param src The array to copy into the buffer.
- *
+ *
* @exception BufferOverflowException If there is insufficient space in this
* buffer for the remaining <code>long</code>s in the source array.
* @exception ReadOnlyBufferException If this buffer is read-only.
@@ -225,7 +225,7 @@ public abstract class LongBuffer extends Buffer
throw new UnsupportedOperationException ();
checkIfReadOnly();
-
+
return backing_buffer;
}
@@ -242,7 +242,7 @@ public abstract class LongBuffer extends Buffer
throw new UnsupportedOperationException ();
checkIfReadOnly();
-
+
return array_offset;
}
@@ -265,8 +265,8 @@ public abstract class LongBuffer extends Buffer
long multiplier = 1;
for (int i = position() + 1; i < limit(); ++i)
{
- multiplier *= 31;
- hashCode += (get(i) + 30)*multiplier;
+ multiplier *= 31;
+ hashCode += (get(i) + 30)*multiplier;
}
return ((int)hashCode);
}
@@ -295,21 +295,21 @@ public abstract class LongBuffer extends Buffer
int num = Math.min(remaining(), other.remaining());
int pos_this = position();
int pos_other = other.position();
-
+
for (int count = 0; count < num; count++)
{
- long a = get(pos_this++);
- long b = other.get(pos_other++);
-
- if (a == b)
- continue;
-
- if (a < b)
- return -1;
-
- return 1;
+ long a = get(pos_this++);
+ long b = other.get(pos_other++);
+
+ if (a == b)
+ continue;
+
+ if (a < b)
+ return -1;
+
+ return 1;
}
-
+
return remaining() - other.remaining();
}
@@ -331,7 +331,7 @@ public abstract class LongBuffer extends Buffer
* Writes the <code>long</code> at this buffer's current position,
* and then increments the position.
*
- * @exception BufferOverflowException If there no remaining
+ * @exception BufferOverflowException If there no remaining
* <code>long</code>s in this buffer.
* @exception ReadOnlyBufferException If this buffer is read-only.
*/
@@ -344,7 +344,7 @@ public abstract class LongBuffer extends Buffer
* than the buffer's limit.
*/
public abstract long get (int index);
-
+
/**
* Absolute put method.
*
@@ -356,7 +356,7 @@ public abstract class LongBuffer extends Buffer
/**
* Compacts this buffer.
- *
+ *
* @exception ReadOnlyBufferException If this buffer is read-only.
*/
public abstract LongBuffer compact ();
diff --git a/libjava/classpath/java/nio/LongBufferImpl.java b/libjava/classpath/java/nio/LongBufferImpl.java
index 4cf922b149d..85502c1940e 100644
--- a/libjava/classpath/java/nio/LongBufferImpl.java
+++ b/libjava/classpath/java/nio/LongBufferImpl.java
@@ -1,4 +1,4 @@
-/* LongBufferImpl.java --
+/* LongBufferImpl.java --
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -49,37 +49,37 @@ final class LongBufferImpl extends LongBuffer
{
this (new long [capacity], 0, capacity, capacity, 0, -1, false);
}
-
+
LongBufferImpl (long[] buffer, int offset, int capacity, int limit,
- int position, int mark, boolean readOnly)
+ int position, int mark, boolean readOnly)
{
super (capacity, limit, position, mark, null, buffer, offset);
this.readOnly = readOnly;
}
-
+
public boolean isReadOnly ()
{
return readOnly;
}
-
+
public LongBuffer slice ()
{
return new LongBufferImpl (backing_buffer, array_offset + position (),
- remaining (), remaining (), 0, -1, isReadOnly ());
+ remaining (), remaining (), 0, -1, isReadOnly ());
}
-
+
public LongBuffer duplicate ()
{
return new LongBufferImpl (backing_buffer, array_offset, capacity (), limit (),
- position (), mark, isReadOnly ());
+ position (), mark, isReadOnly ());
}
-
+
public LongBuffer asReadOnlyBuffer ()
{
return new LongBufferImpl (backing_buffer, array_offset, capacity (), limit (),
- position (), mark, true);
+ position (), mark, true);
}
-
+
public LongBuffer compact ()
{
checkIfReadOnly();
@@ -95,7 +95,7 @@ final class LongBufferImpl extends LongBuffer
limit(capacity());
return this;
}
-
+
public boolean isDirect ()
{
return false;
@@ -116,7 +116,7 @@ final class LongBufferImpl extends LongBuffer
position (position () + 1);
return result;
}
-
+
/**
* Relative put method. Writes <code>value</code> to the next position
* in the buffer.
@@ -134,7 +134,7 @@ final class LongBufferImpl extends LongBuffer
position (position () + 1);
return this;
}
-
+
/**
* Absolute get method. Reads the <code>long</code> at position
* <code>index</code>.
@@ -148,7 +148,7 @@ final class LongBufferImpl extends LongBuffer
return backing_buffer [index];
}
-
+
/**
* Absolute put method. Writes <code>value</code> to position
* <code>index</code> in the buffer.
@@ -165,7 +165,7 @@ final class LongBufferImpl extends LongBuffer
backing_buffer [index] = value;
return this;
}
-
+
public ByteOrder order ()
{
return ByteOrder.nativeOrder ();
diff --git a/libjava/classpath/java/nio/LongViewBufferImpl.java b/libjava/classpath/java/nio/LongViewBufferImpl.java
index b775a99462f..a0a7cd36a74 100644
--- a/libjava/classpath/java/nio/LongViewBufferImpl.java
+++ b/libjava/classpath/java/nio/LongViewBufferImpl.java
@@ -1,4 +1,4 @@
-/* LongViewBufferImpl.java --
+/* LongViewBufferImpl.java --
Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ final class LongViewBufferImpl extends LongBuffer
private final ByteBuffer bb;
private final boolean readOnly;
private final ByteOrder endian;
-
+
LongViewBufferImpl (ByteBuffer bb, int capacity)
{
super (capacity, capacity, 0, -1, bb.isDirect() ?
@@ -55,10 +55,10 @@ final class LongViewBufferImpl extends LongBuffer
this.readOnly = bb.isReadOnly();
this.endian = bb.order();
}
-
+
public LongViewBufferImpl (ByteBuffer bb, int offset, int capacity,
- int limit, int position, int mark,
- boolean readOnly, ByteOrder endian)
+ int limit, int position, int mark,
+ boolean readOnly, ByteOrder endian)
{
super (capacity, limit, position, mark, bb.isDirect() ?
VMDirectByteBuffer.adjustAddress(bb.address, offset):null, null, 0);
@@ -102,7 +102,7 @@ final class LongViewBufferImpl extends LongBuffer
position(p + 1);
return this;
}
-
+
public LongBuffer put (int index, long value)
{
ByteBufferHelper.putLong(bb, (index << 3) + offset, value, endian);
@@ -114,26 +114,26 @@ final class LongViewBufferImpl extends LongBuffer
if (position () > 0)
{
int count = limit () - position ();
- bb.shiftDown(offset, offset + 8 * position(), 8 * count);
+ bb.shiftDown(offset, offset + 8 * position(), 8 * count);
position (count);
limit (capacity ());
}
else
{
- position(limit());
- limit(capacity());
+ position(limit());
+ limit(capacity());
}
return this;
}
-
+
public LongBuffer slice ()
{
// Create a sliced copy of this object that shares its content.
return new LongViewBufferImpl (bb, (position () << 3) + offset,
- remaining(), remaining(), 0, -1,
- readOnly, endian);
+ remaining(), remaining(), 0, -1,
+ readOnly, endian);
}
-
+
LongBuffer duplicate (boolean readOnly)
{
int pos = position();
@@ -141,9 +141,9 @@ final class LongViewBufferImpl extends LongBuffer
int mark = position();
position(pos);
return new LongViewBufferImpl (bb, offset, capacity(), limit(),
- pos, mark, readOnly, endian);
+ pos, mark, readOnly, endian);
}
-
+
public LongBuffer duplicate ()
{
return duplicate(readOnly);
@@ -158,12 +158,12 @@ final class LongViewBufferImpl extends LongBuffer
{
return readOnly;
}
-
+
public boolean isDirect ()
{
return bb.isDirect ();
}
-
+
public ByteOrder order ()
{
return endian;
diff --git a/libjava/classpath/java/nio/MappedByteBuffer.java b/libjava/classpath/java/nio/MappedByteBuffer.java
index 1f82f823f5a..f71e63051c0 100644
--- a/libjava/classpath/java/nio/MappedByteBuffer.java
+++ b/libjava/classpath/java/nio/MappedByteBuffer.java
@@ -1,4 +1,4 @@
-/* MappedByteBuffer.java --
+/* MappedByteBuffer.java --
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,11 +48,11 @@ import gnu.gcj.RawData;
public abstract class MappedByteBuffer extends ByteBuffer
{
MappedByteBuffer (int capacity, int limit, int position, int mark,
- RawData address)
+ RawData address)
{
super (capacity, limit, position, mark, address, null, 0);
}
-
+
void forceImpl()
{
}
@@ -62,7 +62,7 @@ public abstract class MappedByteBuffer extends ByteBuffer
forceImpl();
return this;
}
-
+
boolean isLoadedImpl()
{
load();
@@ -73,7 +73,7 @@ public abstract class MappedByteBuffer extends ByteBuffer
{
return isLoadedImpl();
}
-
+
void loadImpl()
{
}
diff --git a/libjava/classpath/java/nio/MappedByteBufferImpl.java b/libjava/classpath/java/nio/MappedByteBufferImpl.java
index f11d1e72eb2..58ea635cdf6 100644
--- a/libjava/classpath/java/nio/MappedByteBufferImpl.java
+++ b/libjava/classpath/java/nio/MappedByteBufferImpl.java
@@ -1,4 +1,4 @@
-/* MappedByteBufferImpl.java --
+/* MappedByteBufferImpl.java --
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -52,7 +52,7 @@ final class MappedByteBufferImpl extends MappedByteBuffer
/** Posix uses this for the actual length passed to mmap;
* Win32 uses it for the pointer returned by CreateFileMapping. */
public long implLen;
-
+
public MappedByteBufferImpl(Pointer address, int size, boolean readOnly)
throws IOException
{
@@ -64,7 +64,7 @@ final class MappedByteBufferImpl extends MappedByteBuffer
{
return readOnly;
}
-
+
public byte get()
{
checkForUnderflow();
@@ -121,16 +121,16 @@ final class MappedByteBufferImpl extends MappedByteBuffer
int pos = position();
if (pos > 0)
{
- int count = remaining();
- // Call shiftDown method optimized for direct buffers.
- VMDirectByteBuffer.shiftDown(address, 0, pos, count);
- position(count);
- limit(capacity());
+ int count = remaining();
+ // Call shiftDown method optimized for direct buffers.
+ VMDirectByteBuffer.shiftDown(address, 0, pos, count);
+ position(count);
+ limit(capacity());
}
else
{
- position(limit());
- limit(capacity());
+ position(limit());
+ limit(capacity());
}
return this;
}
@@ -169,9 +169,9 @@ final class MappedByteBufferImpl extends MappedByteBuffer
if (mark != pos)
{
- result.position(mark);
- result.mark();
- result.position(pos);
+ result.position(mark);
+ result.mark();
+ result.position(pos);
}
return result;
}
@@ -220,18 +220,18 @@ final class MappedByteBufferImpl extends MappedByteBuffer
{
return ByteBufferHelper.getChar(this, order());
}
-
+
public ByteBuffer putChar(char value)
{
ByteBufferHelper.putChar(this, value, order());
return this;
}
-
+
public char getChar(int index)
{
return ByteBufferHelper.getChar(this, index, order());
}
-
+
public ByteBuffer putChar(int index, char value)
{
ByteBufferHelper.putChar(this, index, value, order());
@@ -242,18 +242,18 @@ final class MappedByteBufferImpl extends MappedByteBuffer
{
return ByteBufferHelper.getShort(this, order());
}
-
+
public ByteBuffer putShort(short value)
{
ByteBufferHelper.putShort(this, value, order());
return this;
}
-
+
public short getShort(int index)
{
return ByteBufferHelper.getShort(this, index, order());
}
-
+
public ByteBuffer putShort(int index, short value)
{
ByteBufferHelper.putShort(this, index, value, order());
@@ -264,18 +264,18 @@ final class MappedByteBufferImpl extends MappedByteBuffer
{
return ByteBufferHelper.getInt(this, order());
}
-
+
public ByteBuffer putInt(int value)
{
ByteBufferHelper.putInt(this, value, order());
return this;
}
-
+
public int getInt(int index)
{
return ByteBufferHelper.getInt(this, index, order());
}
-
+
public ByteBuffer putInt(int index, int value)
{
ByteBufferHelper.putInt(this, index, value, order());
@@ -286,18 +286,18 @@ final class MappedByteBufferImpl extends MappedByteBuffer
{
return ByteBufferHelper.getLong(this, order());
}
-
+
public ByteBuffer putLong(long value)
{
ByteBufferHelper.putLong(this, value, order());
return this;
}
-
+
public long getLong(int index)
{
return ByteBufferHelper.getLong(this, index, order());
}
-
+
public ByteBuffer putLong(int index, long value)
{
ByteBufferHelper.putLong(this, index, value, order());
@@ -308,13 +308,13 @@ final class MappedByteBufferImpl extends MappedByteBuffer
{
return ByteBufferHelper.getFloat(this, order());
}
-
+
public ByteBuffer putFloat(float value)
{
ByteBufferHelper.putFloat(this, value, order());
return this;
}
-
+
public float getFloat(int index)
{
return ByteBufferHelper.getFloat(this, index, order());
@@ -336,12 +336,12 @@ final class MappedByteBufferImpl extends MappedByteBuffer
ByteBufferHelper.putDouble(this, value, order());
return this;
}
-
+
public double getDouble(int index)
{
return ByteBufferHelper.getDouble(this, index, order());
}
-
+
public ByteBuffer putDouble(int index, double value)
{
ByteBufferHelper.putDouble(this, index, value, order());
diff --git a/libjava/classpath/java/nio/ReadOnlyBufferException.java b/libjava/classpath/java/nio/ReadOnlyBufferException.java
index 22f8a6f7379..ea58c375b80 100644
--- a/libjava/classpath/java/nio/ReadOnlyBufferException.java
+++ b/libjava/classpath/java/nio/ReadOnlyBufferException.java
@@ -1,4 +1,4 @@
-/* ReadOnlyBufferException.java --
+/* ReadOnlyBufferException.java --
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
diff --git a/libjava/classpath/java/nio/ShortBuffer.java b/libjava/classpath/java/nio/ShortBuffer.java
index f15c0635577..e7cb12167c8 100644
--- a/libjava/classpath/java/nio/ShortBuffer.java
+++ b/libjava/classpath/java/nio/ShortBuffer.java
@@ -1,4 +1,4 @@
-/* ShortBuffer.java --
+/* ShortBuffer.java --
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -51,8 +51,8 @@ public abstract class ShortBuffer extends Buffer
final short[] backing_buffer;
ShortBuffer (int capacity, int limit, int position,
- int mark, RawData address, short[] backing_buffer,
- int array_offset)
+ int mark, RawData address, short[] backing_buffer,
+ int array_offset)
{
super (capacity, limit, position, mark, address);
this.backing_buffer = backing_buffer;
@@ -87,11 +87,11 @@ public abstract class ShortBuffer extends Buffer
{
return wrap (array, 0, array.length);
}
-
+
/**
* This method transfers <code>short</code>s from this buffer into the given
* destination array. Before the transfer, it checks if there are fewer than
- * length <code>short</code>s remaining in this buffer.
+ * length <code>short</code>s remaining in this buffer.
*
* @param dst The destination array
* @param offset The offset within the array of the first <code>short</code>
@@ -170,7 +170,7 @@ public abstract class ShortBuffer extends Buffer
* must be non-negative and no larger than src.length.
* @param length The number of bytes to be read from the given array;
* must be non-negative and no larger than src.length - offset.
- *
+ *
* @exception BufferOverflowException If there is insufficient space in this
* buffer for the remaining <code>short</code>s in the source array.
* @exception IndexOutOfBoundsException If the preconditions on the offset
@@ -193,7 +193,7 @@ public abstract class ShortBuffer extends Buffer
* into the buffer.
*
* @param src The array to copy into the buffer.
- *
+ *
* @exception BufferOverflowException If there is insufficient space in this
* buffer for the remaining <code>short</code>s in the source array.
* @exception ReadOnlyBufferException If this buffer is read-only.
@@ -226,7 +226,7 @@ public abstract class ShortBuffer extends Buffer
throw new UnsupportedOperationException ();
checkIfReadOnly();
-
+
return backing_buffer;
}
@@ -243,7 +243,7 @@ public abstract class ShortBuffer extends Buffer
throw new UnsupportedOperationException ();
checkIfReadOnly();
-
+
return array_offset;
}
@@ -266,8 +266,8 @@ public abstract class ShortBuffer extends Buffer
int multiplier = 1;
for (int i = position() + 1; i < limit(); ++i)
{
- multiplier *= 31;
- hashCode += (get(i) + 30)*multiplier;
+ multiplier *= 31;
+ hashCode += (get(i) + 30)*multiplier;
}
return hashCode;
}
@@ -296,21 +296,21 @@ public abstract class ShortBuffer extends Buffer
int num = Math.min(remaining(), other.remaining());
int pos_this = position();
int pos_other = other.position();
-
+
for (int count = 0; count < num; count++)
{
- short a = get(pos_this++);
- short b = other.get(pos_other++);
-
- if (a == b)
- continue;
-
- if (a < b)
- return -1;
-
- return 1;
+ short a = get(pos_this++);
+ short b = other.get(pos_other++);
+
+ if (a == b)
+ continue;
+
+ if (a < b)
+ return -1;
+
+ return 1;
}
-
+
return remaining() - other.remaining();
}
@@ -332,7 +332,7 @@ public abstract class ShortBuffer extends Buffer
* Writes the <code>short</code> at this buffer's current position,
* and then increments the position.
*
- * @exception BufferOverflowException If there no remaining
+ * @exception BufferOverflowException If there no remaining
* <code>short</code>s in this buffer.
* @exception ReadOnlyBufferException If this buffer is read-only.
*/
@@ -345,7 +345,7 @@ public abstract class ShortBuffer extends Buffer
* than the buffer's limit.
*/
public abstract short get (int index);
-
+
/**
* Absolute put method.
*
@@ -357,7 +357,7 @@ public abstract class ShortBuffer extends Buffer
/**
* Compacts this buffer.
- *
+ *
* @exception ReadOnlyBufferException If this buffer is read-only.
*/
public abstract ShortBuffer compact ();
diff --git a/libjava/classpath/java/nio/ShortBufferImpl.java b/libjava/classpath/java/nio/ShortBufferImpl.java
index 3a8ff57f822..4d66ec907b0 100644
--- a/libjava/classpath/java/nio/ShortBufferImpl.java
+++ b/libjava/classpath/java/nio/ShortBufferImpl.java
@@ -1,4 +1,4 @@
-/* ShortBufferImpl.java --
+/* ShortBufferImpl.java --
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -49,37 +49,37 @@ final class ShortBufferImpl extends ShortBuffer
{
this (new short [capacity], 0, capacity, capacity, 0, -1, false);
}
-
+
ShortBufferImpl (short[] buffer, int offset, int capacity,
- int limit, int position, int mark, boolean readOnly)
+ int limit, int position, int mark, boolean readOnly)
{
super (capacity, limit, position, mark, null, buffer, offset);
this.readOnly = readOnly;
}
-
+
public boolean isReadOnly ()
{
return readOnly;
}
-
+
public ShortBuffer slice ()
{
return new ShortBufferImpl (backing_buffer, array_offset + position (),
- remaining (), remaining (), 0, -1, isReadOnly ());
+ remaining (), remaining (), 0, -1, isReadOnly ());
}
-
+
public ShortBuffer duplicate ()
{
return new ShortBufferImpl (backing_buffer, array_offset, capacity (),
- limit (), position (), mark, isReadOnly ());
+ limit (), position (), mark, isReadOnly ());
}
-
+
public ShortBuffer asReadOnlyBuffer ()
{
return new ShortBufferImpl (backing_buffer, array_offset, capacity (), limit (),
- position (), mark, true);
+ position (), mark, true);
}
-
+
public ShortBuffer compact ()
{
checkIfReadOnly();
@@ -95,7 +95,7 @@ final class ShortBufferImpl extends ShortBuffer
limit(capacity());
return this;
}
-
+
public boolean isDirect ()
{
return false;
@@ -116,12 +116,12 @@ final class ShortBufferImpl extends ShortBuffer
position (position () + 1);
return result;
}
-
+
/**
* Relative put method. Writes <code>value</code> to the next position
* in the buffer.
*
- * @exception BufferOverflowException If there no remaining
+ * @exception BufferOverflowException If there no remaining
* space in this buffer.
* @exception ReadOnlyBufferException If this buffer is read-only.
*/
@@ -134,7 +134,7 @@ final class ShortBufferImpl extends ShortBuffer
position (position () + 1);
return this;
}
-
+
/**
* Absolute get method. Reads the <code>short</code> at position
* <code>index</code>.
@@ -148,7 +148,7 @@ final class ShortBufferImpl extends ShortBuffer
return backing_buffer [index];
}
-
+
/**
* Absolute put method. Writes <code>value</code> to position
* <code>index</code> in the buffer.
@@ -165,7 +165,7 @@ final class ShortBufferImpl extends ShortBuffer
backing_buffer [index] = value;
return this;
}
-
+
public ByteOrder order ()
{
return ByteOrder.nativeOrder ();
diff --git a/libjava/classpath/java/nio/ShortViewBufferImpl.java b/libjava/classpath/java/nio/ShortViewBufferImpl.java
index 627085556f6..f7ef3e34657 100644
--- a/libjava/classpath/java/nio/ShortViewBufferImpl.java
+++ b/libjava/classpath/java/nio/ShortViewBufferImpl.java
@@ -1,4 +1,4 @@
-/* ShortViewBufferImpl.java --
+/* ShortViewBufferImpl.java --
Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -50,20 +50,20 @@ final class ShortViewBufferImpl extends ShortBuffer
{
super (capacity, capacity, 0, -1, bb.isDirect() ?
VMDirectByteBuffer.adjustAddress(bb.address, bb.position()):null,
- null, 0);
+ null, 0);
this.bb = bb;
this.offset = bb.position();
this.readOnly = bb.isReadOnly();
this.endian = bb.order();
}
-
+
public ShortViewBufferImpl (ByteBuffer bb, int offset, int capacity,
- int limit, int position, int mark,
- boolean readOnly, ByteOrder endian)
+ int limit, int position, int mark,
+ boolean readOnly, ByteOrder endian)
{
super (capacity, limit, position, mark, bb.isDirect() ?
VMDirectByteBuffer.adjustAddress(bb.address, offset):null,
- null, 0);
+ null, 0);
this.bb = bb;
this.offset = offset;
this.readOnly = readOnly;
@@ -104,7 +104,7 @@ final class ShortViewBufferImpl extends ShortBuffer
position(p + 1);
return this;
}
-
+
public ShortBuffer put (int index, short value)
{
ByteBufferHelper.putShort(bb, (index << 1) + offset, value, endian);
@@ -116,26 +116,26 @@ final class ShortViewBufferImpl extends ShortBuffer
if (position () > 0)
{
int count = limit () - position ();
- bb.shiftDown(offset, offset + 2 * position(), 2 * count);
+ bb.shiftDown(offset, offset + 2 * position(), 2 * count);
position (count);
limit (capacity ());
}
else
{
- position(limit());
- limit(capacity());
+ position(limit());
+ limit(capacity());
}
return this;
}
-
+
public ShortBuffer slice ()
{
// Create a sliced copy of this object that shares its content.
return new ShortViewBufferImpl (bb, (position () << 1) + offset,
- remaining(), remaining(), 0, -1,
- readOnly, endian);
+ remaining(), remaining(), 0, -1,
+ readOnly, endian);
}
-
+
ShortBuffer duplicate (boolean readOnly)
{
int pos = position();
@@ -143,9 +143,9 @@ final class ShortViewBufferImpl extends ShortBuffer
int mark = position();
position(pos);
return new ShortViewBufferImpl (bb, offset, capacity(), limit(),
- pos, mark, readOnly, endian);
+ pos, mark, readOnly, endian);
}
-
+
public ShortBuffer duplicate ()
{
return duplicate(readOnly);
@@ -160,12 +160,12 @@ final class ShortViewBufferImpl extends ShortBuffer
{
return readOnly;
}
-
+
public boolean isDirect ()
{
return bb.isDirect ();
}
-
+
public ByteOrder order ()
{
return endian;
diff --git a/libjava/classpath/java/nio/channels/FileChannel.java b/libjava/classpath/java/nio/channels/FileChannel.java
index 3aa19990917..8c8029fe764 100644
--- a/libjava/classpath/java/nio/channels/FileChannel.java
+++ b/libjava/classpath/java/nio/channels/FileChannel.java
@@ -71,9 +71,9 @@ public abstract class FileChannel extends AbstractInterruptibleChannel
public String toString()
{
if (this == READ_ONLY)
- return "READ_ONLY";
+ return "READ_ONLY";
else if (this == READ_WRITE)
- return "READ_WRITE";
+ return "READ_WRITE";
return "PRIVATE";
}
diff --git a/libjava/classpath/java/nio/channels/SocketChannel.java b/libjava/classpath/java/nio/channels/SocketChannel.java
index 50f21368c88..324c9816bdd 100644
--- a/libjava/classpath/java/nio/channels/SocketChannel.java
+++ b/libjava/classpath/java/nio/channels/SocketChannel.java
@@ -64,7 +64,7 @@ public abstract class SocketChannel extends AbstractSelectableChannel
* Opens a socket channel.
*
* @return the new <code>SocketChannel</code> object
- *
+ *
* @exception IOException If an error occurs
*/
public static SocketChannel open() throws IOException
@@ -76,7 +76,7 @@ public abstract class SocketChannel extends AbstractSelectableChannel
* Opens a channel and connects it to a remote address.
*
* @return the new <code>SocketChannel</code> object
- *
+ *
* @exception AsynchronousCloseException If this channel is already connected.
* @exception ClosedByInterruptException If another thread interrupts the
* current thread while the connect operation is in progress, thereby closing
@@ -120,7 +120,7 @@ public abstract class SocketChannel extends AbstractSelectableChannel
* Writes data to the channel.
*
* @return the number of bytes written, zero is valid too
- *
+ *
* @exception IOException If an error occurs
* @exception NotYetConnectedException If this channel is not yet connected.
*/
@@ -150,7 +150,7 @@ public abstract class SocketChannel extends AbstractSelectableChannel
*
* @return the number of bytes read, zero is valid too, -1 if end of stream
* is reached
- *
+ *
* @exception IOException If an error occurs
* @exception NotYetConnectedException If this channel is not yet connected.
*/
@@ -162,7 +162,7 @@ public abstract class SocketChannel extends AbstractSelectableChannel
* @return <code>true</code> if the channel got successfully connected,
* <code>false</code> if the channel is in non-blocking mode and connection
* operation is still in progress.
- *
+ *
* @exception AlreadyConnectedException If this channel is already connected.
* @exception AsynchronousCloseException If this channel is already connected.
* @exception ClosedByInterruptException If another thread interrupts the
@@ -211,7 +211,7 @@ public abstract class SocketChannel extends AbstractSelectableChannel
*
* @return the number of bytes read, zero is valid too, -1 if end of stream
* is reached
- *
+ *
* @exception IOException If an error occurs
* @exception NotYetConnectedException If this channel is not yet connected.
*/
@@ -229,7 +229,7 @@ public abstract class SocketChannel extends AbstractSelectableChannel
* Writes data to the channel.
*
* @return the number of bytes written, zero is valid too
- *
+ *
* @exception IOException If an error occurs
* @exception NotYetConnectedException If this channel is not yet connected.
*/
@@ -239,7 +239,7 @@ public abstract class SocketChannel extends AbstractSelectableChannel
* Writes data to the channel.
*
* @return the number of bytes written, zero is valid too
- *
+ *
* @exception IOException If an error occurs
* @exception NotYetConnectedException If this channel is not yet connected.
*/
diff --git a/libjava/classpath/java/nio/channels/spi/AbstractInterruptibleChannel.java b/libjava/classpath/java/nio/channels/spi/AbstractInterruptibleChannel.java
index 8e5b7b0b158..b1ed7c7f2b1 100644
--- a/libjava/classpath/java/nio/channels/spi/AbstractInterruptibleChannel.java
+++ b/libjava/classpath/java/nio/channels/spi/AbstractInterruptibleChannel.java
@@ -1,4 +1,4 @@
-/* AbstractInterruptibleChannel.java --
+/* AbstractInterruptibleChannel.java --
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -76,8 +76,8 @@ public abstract class AbstractInterruptibleChannel
{
if (! closed)
{
- closed = true;
- implCloseChannel();
+ closed = true;
+ implCloseChannel();
}
}
@@ -96,7 +96,7 @@ public abstract class AbstractInterruptibleChannel
throws AsynchronousCloseException
{
// FIXME: check more here.
-
+
if (closed) throw new AsynchronousCloseException();
}
@@ -109,8 +109,8 @@ public abstract class AbstractInterruptibleChannel
/**
* Tells whether or not this channel is open.
- *
- * @return true if the channel is open, false otherwise
+ *
+ * @return true if the channel is open, false otherwise
*/
public final boolean isOpen()
{
diff --git a/libjava/classpath/java/nio/channels/spi/AbstractSelectableChannel.java b/libjava/classpath/java/nio/channels/spi/AbstractSelectableChannel.java
index 5d5277b4a68..97ed685b8ff 100644
--- a/libjava/classpath/java/nio/channels/spi/AbstractSelectableChannel.java
+++ b/libjava/classpath/java/nio/channels/spi/AbstractSelectableChannel.java
@@ -90,11 +90,11 @@ public abstract class AbstractSelectableChannel extends SelectableChannel
{
synchronized (blockingLock())
{
- if (this.blocking != blocking)
- {
- implConfigureBlocking(blocking);
- this.blocking = blocking;
- }
+ if (this.blocking != blocking)
+ {
+ implConfigureBlocking(blocking);
+ this.blocking = blocking;
+ }
}
return this;
@@ -173,14 +173,14 @@ public abstract class AbstractSelectableChannel extends SelectableChannel
try
{
- synchronized (blockingLock())
- {
- return locate(selector);
- }
+ synchronized (blockingLock())
+ {
+ return locate(selector);
+ }
}
catch (Exception e)
{
- return null;
+ return null;
}
}
@@ -200,10 +200,10 @@ public abstract class AbstractSelectableChannel extends SelectableChannel
while (it.hasNext())
{
- SelectionKey key = (SelectionKey) it.next();
+ SelectionKey key = (SelectionKey) it.next();
- if (key.selector() == selector)
- return key;
+ if (key.selector() == selector)
+ return key;
}
return null;
@@ -217,7 +217,7 @@ public abstract class AbstractSelectableChannel extends SelectableChannel
* @param att an attachment for the returned selection key
*
* @return the registered selection key
- *
+ *
* @exception ClosedChannelException If the channel is already closed.
* @exception IllegalBlockingModeException If the channel is configured in
* blocking mode.
@@ -230,29 +230,29 @@ public abstract class AbstractSelectableChannel extends SelectableChannel
if ((ops & ~validOps()) != 0)
throw new IllegalArgumentException();
-
+
SelectionKey key = null;
AbstractSelector selector = (AbstractSelector) selin;
synchronized (blockingLock())
{
- if (blocking)
- throw new IllegalBlockingModeException();
+ if (blocking)
+ throw new IllegalBlockingModeException();
- key = locate(selector);
+ key = locate(selector);
- if (key != null && key.isValid())
- {
+ if (key != null && key.isValid())
+ {
key.interestOps(ops);
key.attach(att);
- }
- else
- {
- key = selector.register(this, ops, att);
-
- if (key != null)
- addSelectionKey(key);
- }
+ }
+ else
+ {
+ key = selector.register(this, ops, att);
+
+ if (key != null)
+ addSelectionKey(key);
+ }
}
return key;
diff --git a/libjava/classpath/java/nio/channels/spi/AbstractSelectionKey.java b/libjava/classpath/java/nio/channels/spi/AbstractSelectionKey.java
index 02d09ce10ad..e0dc03f5345 100644
--- a/libjava/classpath/java/nio/channels/spi/AbstractSelectionKey.java
+++ b/libjava/classpath/java/nio/channels/spi/AbstractSelectionKey.java
@@ -61,8 +61,8 @@ public abstract class AbstractSelectionKey extends SelectionKey
{
if (isValid())
{
- ((AbstractSelector) selector()).cancelKey(this);
- cancelled = true;
+ ((AbstractSelector) selector()).cancelKey(this);
+ cancelled = true;
}
}
diff --git a/libjava/classpath/java/nio/channels/spi/AbstractSelector.java b/libjava/classpath/java/nio/channels/spi/AbstractSelector.java
index 73f5077df92..b67d4aeccf1 100644
--- a/libjava/classpath/java/nio/channels/spi/AbstractSelector.java
+++ b/libjava/classpath/java/nio/channels/spi/AbstractSelector.java
@@ -132,7 +132,7 @@ public abstract class AbstractSelector extends Selector
{
synchronized (cancelledKeys)
{
- cancelledKeys.add(key);
+ cancelledKeys.add(key);
}
}
diff --git a/libjava/classpath/java/nio/channels/spi/SelectorProvider.java b/libjava/classpath/java/nio/channels/spi/SelectorProvider.java
index b2fb7bb9c81..821bc436152 100644
--- a/libjava/classpath/java/nio/channels/spi/SelectorProvider.java
+++ b/libjava/classpath/java/nio/channels/spi/SelectorProvider.java
@@ -72,7 +72,7 @@ public abstract class SelectorProvider
* Opens a datagram channel.
*
* @return a new datagram channel object
- *
+ *
* @exception IOException if an error occurs
*/
public abstract DatagramChannel openDatagramChannel()
@@ -82,7 +82,7 @@ public abstract class SelectorProvider
* Opens a pipe.
*
* @return a new pipe object
- *
+ *
* @exception IOException if an error occurs
*/
public abstract Pipe openPipe() throws IOException;
@@ -91,7 +91,7 @@ public abstract class SelectorProvider
* Opens a selector.
*
* @return a new selector object
- *
+ *
* @exception IOException if an error occurs
*/
public abstract AbstractSelector openSelector() throws IOException;
@@ -100,7 +100,7 @@ public abstract class SelectorProvider
* Opens a server socket channel.
*
* @return a new server socket channel object
- *
+ *
* @exception IOException if an error occurs
*/
public abstract ServerSocketChannel openServerSocketChannel()
@@ -110,7 +110,7 @@ public abstract class SelectorProvider
* Opens a socket channel.
*
* @return a new socket channel object
- *
+ *
* @exception IOException if an error occurs
*/
public abstract SocketChannel openSocketChannel() throws IOException;
@@ -151,26 +151,26 @@ public abstract class SelectorProvider
{
if (systemDefaultProvider == null)
{
- String propertyValue =
- System.getProperty("java.nio.channels.spi.SelectorProvider");
-
- if (propertyValue == null || propertyValue.equals(""))
- systemDefaultProvider = new SelectorProviderImpl();
- else
- {
- try
- {
- systemDefaultProvider =
- (SelectorProvider) Class.forName(propertyValue)
- .newInstance();
- }
- catch (Exception e)
- {
- System.err.println("Could not instantiate class: "
- + propertyValue);
- systemDefaultProvider = new SelectorProviderImpl();
- }
- }
+ String propertyValue =
+ System.getProperty("java.nio.channels.spi.SelectorProvider");
+
+ if (propertyValue == null || propertyValue.equals(""))
+ systemDefaultProvider = new SelectorProviderImpl();
+ else
+ {
+ try
+ {
+ systemDefaultProvider =
+ (SelectorProvider) Class.forName(propertyValue)
+ .newInstance();
+ }
+ catch (Exception e)
+ {
+ System.err.println("Could not instantiate class: "
+ + propertyValue);
+ systemDefaultProvider = new SelectorProviderImpl();
+ }
+ }
}
return systemDefaultProvider;
diff --git a/libjava/classpath/java/nio/charset/CharacterCodingException.java b/libjava/classpath/java/nio/charset/CharacterCodingException.java
index d0580c95548..05f1e3aea11 100644
--- a/libjava/classpath/java/nio/charset/CharacterCodingException.java
+++ b/libjava/classpath/java/nio/charset/CharacterCodingException.java
@@ -1,4 +1,4 @@
-/* CharacterCodingException.java --
+/* CharacterCodingException.java --
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
diff --git a/libjava/classpath/java/nio/charset/Charset.java b/libjava/classpath/java/nio/charset/Charset.java
index 924e005e65a..1757b82ea60 100644
--- a/libjava/classpath/java/nio/charset/Charset.java
+++ b/libjava/classpath/java/nio/charset/Charset.java
@@ -1,4 +1,4 @@
-/* Charset.java --
+/* Charset.java --
Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -64,15 +64,15 @@ public abstract class Charset implements Comparable<Charset>
{
private CharsetEncoder cachedEncoder;
private CharsetDecoder cachedDecoder;
-
+
/**
* Extra Charset providers.
*/
private static CharsetProvider[] providers;
-
+
private final String canonicalName;
private final String[] aliases;
-
+
protected Charset (String canonicalName, String[] aliases)
{
checkName (canonicalName);
@@ -121,45 +121,45 @@ public abstract class Charset implements Comparable<Charset>
*
* This may be set by the user or VM with the file.encoding
* property.
- *
+ *
* @since 1.5
*/
public static Charset defaultCharset()
{
String encoding;
-
- try
+
+ try
{
- encoding = SystemProperties.getProperty("file.encoding");
+ encoding = SystemProperties.getProperty("file.encoding");
}
catch(SecurityException e)
{
- // Use fallback.
- encoding = "ISO-8859-1";
+ // Use fallback.
+ encoding = "ISO-8859-1";
}
catch(IllegalArgumentException e)
{
- // Use fallback.
- encoding = "ISO-8859-1";
+ // Use fallback.
+ encoding = "ISO-8859-1";
}
try
{
- return forName(encoding);
+ return forName(encoding);
}
catch(UnsupportedCharsetException e)
{
- // Ignore.
+ // Ignore.
}
catch(IllegalCharsetNameException e)
{
- // Ignore.
+ // Ignore.
}
catch(IllegalArgumentException e)
{
- // Ignore.
+ // Ignore.
}
-
+
throw new IllegalStateException("Can't get default charset!");
}
@@ -170,7 +170,7 @@ public abstract class Charset implements Comparable<Charset>
/**
* Returns the Charset instance for the charset of the given name.
- *
+ *
* @param charsetName
* @return the Charset instance for the indicated charset
* @throws UnsupportedCharsetException if this VM does not support
@@ -184,7 +184,7 @@ public abstract class Charset implements Comparable<Charset>
// Throws IllegalArgumentException as the JDK does.
if(charsetName == null)
throw new IllegalArgumentException("Charset name must not be null.");
-
+
Charset cs = charsetForName (charsetName);
if (cs == null)
throw new UnsupportedCharsetException (charsetName);
@@ -208,13 +208,13 @@ public abstract class Charset implements Comparable<Charset>
Charset cs = provider().charsetForName(charsetName);
if (cs == null)
{
- CharsetProvider[] providers = providers2();
- for (int i = 0; i < providers.length; i++)
- {
- cs = providers[i].charsetForName(charsetName);
- if (cs != null)
- break;
- }
+ CharsetProvider[] providers = providers2();
+ for (int i = 0; i < providers.length; i++)
+ {
+ cs = providers[i].charsetForName(charsetName);
+ if (cs != null)
+ break;
+ }
}
return cs;
}
@@ -225,8 +225,8 @@ public abstract class Charset implements Comparable<Charset>
= new TreeMap(String.CASE_INSENSITIVE_ORDER);
for (Iterator<Charset> i = provider().charsets(); i.hasNext(); )
{
- Charset cs = i.next();
- charsets.put(cs.name(), cs);
+ Charset cs = i.next();
+ charsets.put(cs.name(), cs);
}
CharsetProvider[] providers = providers2();
@@ -333,21 +333,21 @@ public abstract class Charset implements Comparable<Charset>
{
try
{
- if (cachedEncoder == null)
- {
- cachedEncoder = newEncoder ()
- .onMalformedInput (CodingErrorAction.REPLACE)
- .onUnmappableCharacter (CodingErrorAction.REPLACE);
- } else
- cachedEncoder.reset();
- return cachedEncoder.encode (cb);
+ if (cachedEncoder == null)
+ {
+ cachedEncoder = newEncoder ()
+ .onMalformedInput (CodingErrorAction.REPLACE)
+ .onUnmappableCharacter (CodingErrorAction.REPLACE);
+ } else
+ cachedEncoder.reset();
+ return cachedEncoder.encode (cb);
}
catch (CharacterCodingException e)
{
throw new AssertionError (e);
}
}
-
+
public final ByteBuffer encode (String str)
{
return encode (CharBuffer.wrap (str));
@@ -361,15 +361,15 @@ public abstract class Charset implements Comparable<Charset>
{
try
{
- if (cachedDecoder == null)
- {
- cachedDecoder = newDecoder ()
- .onMalformedInput (CodingErrorAction.REPLACE)
- .onUnmappableCharacter (CodingErrorAction.REPLACE);
- } else
- cachedDecoder.reset();
-
- return cachedDecoder.decode (bb);
+ if (cachedDecoder == null)
+ {
+ cachedDecoder = newDecoder ()
+ .onMalformedInput (CodingErrorAction.REPLACE)
+ .onUnmappableCharacter (CodingErrorAction.REPLACE);
+ } else
+ cachedDecoder.reset();
+
+ return cachedDecoder.decode (bb);
}
catch (CharacterCodingException e)
{
diff --git a/libjava/classpath/java/nio/charset/CharsetDecoder.java b/libjava/classpath/java/nio/charset/CharsetDecoder.java
index c86f1c8a4ad..cf43feafd8e 100644
--- a/libjava/classpath/java/nio/charset/CharsetDecoder.java
+++ b/libjava/classpath/java/nio/charset/CharsetDecoder.java
@@ -1,4 +1,4 @@
-/* CharsetDecoder.java --
+/* CharsetDecoder.java --
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -160,7 +160,7 @@ public abstract class CharsetDecoder
cr = decodeLoop (in, out);
}
catch (RuntimeException e)
- {
+ {
throw new CoderMalfunctionError (e);
}
@@ -199,7 +199,7 @@ public abstract class CharsetDecoder
{
throw new UnsupportedOperationException ();
}
-
+
public final CoderResult flush (CharBuffer out)
{
// It seems weird that you can flush after reset, but Sun's javadoc
diff --git a/libjava/classpath/java/nio/charset/CharsetEncoder.java b/libjava/classpath/java/nio/charset/CharsetEncoder.java
index 932fe355df9..1f079a3cc91 100644
--- a/libjava/classpath/java/nio/charset/CharsetEncoder.java
+++ b/libjava/classpath/java/nio/charset/CharsetEncoder.java
@@ -1,4 +1,4 @@
-/* CharsetEncoder.java --
+/* CharsetEncoder.java --
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -50,7 +50,7 @@ public abstract class CharsetEncoder
private static final int STATE_CODING = 1;
private static final int STATE_END = 2;
private static final int STATE_FLUSHED = 3;
-
+
private static final byte[] DEFAULT_REPLACEMENT = {(byte)'?'};
private final Charset charset;
@@ -71,7 +71,7 @@ public abstract class CharsetEncoder
this (cs, averageBytesPerChar, maxBytesPerChar, DEFAULT_REPLACEMENT);
}
- protected CharsetEncoder (Charset cs, float averageBytesPerChar,
+ protected CharsetEncoder (Charset cs, float averageBytesPerChar,
float maxBytesPerChar, byte[] replacement)
{
if (averageBytesPerChar <= 0.0f)
@@ -87,7 +87,7 @@ public abstract class CharsetEncoder
this.replacement = replacement;
implReplaceWith (replacement);
}
-
+
public final float averageBytesPerChar ()
{
return averageBytesPerChar;
diff --git a/libjava/classpath/java/nio/charset/CoderMalfunctionError.java b/libjava/classpath/java/nio/charset/CoderMalfunctionError.java
index 5770aded628..f7a32d20783 100644
--- a/libjava/classpath/java/nio/charset/CoderMalfunctionError.java
+++ b/libjava/classpath/java/nio/charset/CoderMalfunctionError.java
@@ -1,4 +1,4 @@
-/* CoderMalfunctionError.java --
+/* CoderMalfunctionError.java --
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
diff --git a/libjava/classpath/java/nio/charset/CoderResult.java b/libjava/classpath/java/nio/charset/CoderResult.java
index 304d9d70895..b083d840e2d 100644
--- a/libjava/classpath/java/nio/charset/CoderResult.java
+++ b/libjava/classpath/java/nio/charset/CoderResult.java
@@ -1,4 +1,4 @@
-/* CoderResult.java --
+/* CoderResult.java --
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,7 +47,7 @@ import java.util.HashMap;
* @since 1.4
*/
public class CoderResult
-{
+{
private static final int TYPE_MALFORMED = 0;
private static final int TYPE_OVERFLOW = 1;
private static final int TYPE_UNDERFLOW = 2;
@@ -57,7 +57,7 @@ public class CoderResult
= new CoderResult (TYPE_OVERFLOW, 0);
public static final CoderResult UNDERFLOW
= new CoderResult (TYPE_UNDERFLOW, 0);
-
+
private static final String[] names
= { "MALFORMED", "OVERFLOW", "UNDERFLOW", "UNMAPPABLE" };
@@ -126,7 +126,7 @@ public class CoderResult
{
return malformedCache.get (length);
}
-
+
public void throwException ()
throws CharacterCodingException
{
@@ -152,7 +152,7 @@ public class CoderResult
public static CoderResult unmappableForLength (int length)
{
return unmappableCache.get (length);
- }
+ }
private abstract static class Cache
{
diff --git a/libjava/classpath/java/nio/charset/CodingErrorAction.java b/libjava/classpath/java/nio/charset/CodingErrorAction.java
index 592c15934ac..3b64030977c 100644
--- a/libjava/classpath/java/nio/charset/CodingErrorAction.java
+++ b/libjava/classpath/java/nio/charset/CodingErrorAction.java
@@ -1,4 +1,4 @@
-/* CodingErrorAction.java --
+/* CodingErrorAction.java --
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,11 +40,11 @@ package java.nio.charset;
public class CodingErrorAction
{
public static final CodingErrorAction IGNORE
- = new CodingErrorAction("ignore");
+ = new CodingErrorAction("ignore");
public static final CodingErrorAction REPLACE
- = new CodingErrorAction("replace");
+ = new CodingErrorAction("replace");
public static final CodingErrorAction REPORT
- = new CodingErrorAction("report");
+ = new CodingErrorAction("report");
private final String name;
diff --git a/libjava/classpath/java/nio/charset/IllegalCharsetNameException.java b/libjava/classpath/java/nio/charset/IllegalCharsetNameException.java
index 7baeac3234e..0e05d4dbfd2 100644
--- a/libjava/classpath/java/nio/charset/IllegalCharsetNameException.java
+++ b/libjava/classpath/java/nio/charset/IllegalCharsetNameException.java
@@ -1,4 +1,4 @@
-/* IllegalCharsetNameException.java --
+/* IllegalCharsetNameException.java --
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,9 +47,9 @@ public class IllegalCharsetNameException extends IllegalArgumentException
* Compatible with JDK 1.4+
*/
private static final long serialVersionUID = 1457525358470002989L;
-
+
private String charsetName;
-
+
/**
* Creates the exception
*
diff --git a/libjava/classpath/java/nio/charset/MalformedInputException.java b/libjava/classpath/java/nio/charset/MalformedInputException.java
index 463d36868f3..3870b55bea1 100644
--- a/libjava/classpath/java/nio/charset/MalformedInputException.java
+++ b/libjava/classpath/java/nio/charset/MalformedInputException.java
@@ -1,4 +1,4 @@
-/* MalformedInputException.java --
+/* MalformedInputException.java --
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ public class MalformedInputException extends CharacterCodingException
private static final long serialVersionUID = - 3438823399834806194L;
private int inputLength;
-
+
/**
* Creates the exception
*
diff --git a/libjava/classpath/java/nio/charset/UnmappableCharacterException.java b/libjava/classpath/java/nio/charset/UnmappableCharacterException.java
index d22a23807b6..d9cdb49cf7a 100644
--- a/libjava/classpath/java/nio/charset/UnmappableCharacterException.java
+++ b/libjava/classpath/java/nio/charset/UnmappableCharacterException.java
@@ -1,4 +1,4 @@
-/* UnmappableCharacterException.java --
+/* UnmappableCharacterException.java --
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ public class UnmappableCharacterException extends CharacterCodingException
private static final long serialVersionUID = - 7026962371537706123L;
private int inputLength;
-
+
/**
* Creates the exception
*/
diff --git a/libjava/classpath/java/nio/charset/UnsupportedCharsetException.java b/libjava/classpath/java/nio/charset/UnsupportedCharsetException.java
index 39536baa563..c4f9d17fd71 100644
--- a/libjava/classpath/java/nio/charset/UnsupportedCharsetException.java
+++ b/libjava/classpath/java/nio/charset/UnsupportedCharsetException.java
@@ -1,4 +1,4 @@
-/* UnsupportedCharsetException.java --
+/* UnsupportedCharsetException.java --
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,9 +47,9 @@ public class UnsupportedCharsetException extends IllegalArgumentException
* Compatible with JDK 1.4+
*/
private static final long serialVersionUID = 1490765524727386367L;
-
+
String charsetName;
-
+
/**
* Creates the exception
*/
OpenPOWER on IntegriCloud