src/share/classes/java/nio/Buffer.java
Print this page
@@ -237,11 +237,11 @@
* @return This buffer
*
* @throws IllegalArgumentException
* If the preconditions on <tt>newPosition</tt> do not hold
*/
- public final Buffer position(int newPosition) {
+ public Buffer position(int newPosition) {
if ((newPosition > limit) || (newPosition < 0))
throw new IllegalArgumentException();
position = newPosition;
if (mark > position) mark = -1;
return this;
@@ -268,11 +268,11 @@
* @return This buffer
*
* @throws IllegalArgumentException
* If the preconditions on <tt>newLimit</tt> do not hold
*/
- public final Buffer limit(int newLimit) {
+ public Buffer limit(int newLimit) {
if ((newLimit > capacity) || (newLimit < 0))
throw new IllegalArgumentException();
limit = newLimit;
if (position > limit) position = limit;
if (mark > limit) mark = -1;
@@ -282,11 +282,11 @@
/**
* Sets this buffer's mark at its position.
*
* @return This buffer
*/
- public final Buffer mark() {
+ public Buffer mark() {
mark = position;
return this;
}
/**
@@ -298,11 +298,11 @@
* @return This buffer
*
* @throws InvalidMarkException
* If the mark has not been set
*/
- public final Buffer reset() {
+ public Buffer reset() {
int m = mark;
if (m < 0)
throw new InvalidMarkException();
position = m;
return this;
@@ -323,11 +323,11 @@
* is named as if it did because it will most often be used in situations
* in which that might as well be the case. </p>
*
* @return This buffer
*/
- public final Buffer clear() {
+ public Buffer clear() {
position = 0;
limit = capacity;
mark = -1;
return this;
}
@@ -351,11 +351,11 @@
* java.nio.ByteBuffer#compact compact} method when transferring data from
* one place to another. </p>
*
* @return This buffer
*/
- public final Buffer flip() {
+ public Buffer flip() {
limit = position;
position = 0;
mark = -1;
return this;
}
@@ -373,11 +373,11 @@
* buf.rewind(); // Rewind buffer
* buf.get(array); // Copy data into array</pre></blockquote>
*
* @return This buffer
*/
- public final Buffer rewind() {
+ public Buffer rewind() {
position = 0;
mark = -1;
return this;
}