diff options
author | Dalibor Topic <robilad@yahoo.com> | 2004-06-16 08:57:10 +0000 |
---|---|---|
committer | Dalibor Topic <robilad@yahoo.com> | 2004-06-16 08:57:10 +0000 |
commit | 891026f13064972d24e015b77304a63514a69a5e (patch) | |
tree | 9c50f2517b987ac7b3c9c4fb793f2fb7d2e00e6f /java/nio/FloatViewBufferImpl.java | |
parent | cbcddf051550f73562cef616d1568685c8f155a4 (diff) | |
download | classpath-891026f13064972d24e015b77304a63514a69a5e.tar.gz |
Improved nio error checking
2003-06-15 Dalibor Topic <robilad@kaffe.org>
* java/nio/Buffer.java,
java/nio/ByteBuffer.java,
java/nio/ByteBufferHelper.java,
java/nio/ByteBufferImpl.java,
java/nio/CharBuffer.java,
java/nio/CharBufferImpl.java,
java/nio/CharViewBufferImpl.java,
java/nio/DirectByteBufferImpl.java,
java/nio/DoubleBuffer.java,
java/nio/DoubleBufferImpl.java,
java/nio/DoubleViewBufferImpl.java,
java/nio/FloatBuffer.java,
java/nio/FloatBufferImpl.java,
java/nio/FloatViewBufferImpl.java,
java/nio/IntBuffer.java,
java/nio/IntBufferImpl.java,
java/nio/IntViewBufferImpl.java,
java/nio/LongBuffer.java,
java/nio/LongBufferImpl.java,
java/nio/LongViewBufferImpl.java,
java/nio/MappedByteBufferImpl.java,
java/nio/ShortBuffer.java,
java/nio/ShortBufferImpl.java,
java/nio/ShortViewBufferImpl.java:
Fixed javadocs all over. Improved input error
checking.
* java/nio/Buffer.java:
(checkForUnderflow, checkForOverflow, checkIndex,
checkIfReadOnly, checkArraySize) New helper methods
for error checking.
* java/nio/ByteBufferHelper.java:
(checkRemainingForRead, checkRemainingForWrite,
checkAvailableForRead, checkAvailableForWrite) Removed
no longer needed methods.
Diffstat (limited to 'java/nio/FloatViewBufferImpl.java')
-rw-r--r-- | java/nio/FloatViewBufferImpl.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/java/nio/FloatViewBufferImpl.java b/java/nio/FloatViewBufferImpl.java index 08c59097d..40b7339dd 100644 --- a/java/nio/FloatViewBufferImpl.java +++ b/java/nio/FloatViewBufferImpl.java @@ -66,6 +66,13 @@ final class FloatViewBufferImpl extends FloatBuffer this.endian = endian; } + /** + * Reads the <code>float</code> at this buffer's current position, + * and then increments the position. + * + * @exception BufferUnderflowException If there are no remaining + * <code>floats</code> in this buffer. + */ public float get () { int p = position(); @@ -74,6 +81,13 @@ final class FloatViewBufferImpl extends FloatBuffer return result; } + /** + * Absolute get method. Reads the <code>float</code> at position + * <code>index</code>. + * + * @exception IndexOutOfBoundsException If index is negative or not smaller + * than the buffer's limit. + */ public float get (int index) { return ByteBufferHelper.getFloat(bb, (index << 2) + offset, endian); |