Commit 1adef668 by Michael Koch Committed by Michael Koch

2003-10-13 Michael Koch <konqueror@gmx.de>

	* java/nio/Buffer.java
	(hasRemaining): Made implementation more clear.
	* java/nio/MappedByteBuffer.java
	(loaded): New member variable.
	(force): Added comment.
	(isLoaded): Return value of loaded.
	(load): Set loaded to true, added comment.

From-SVN: r72418
parent bc9b32c2
2003-10-13 Michael Koch <konqueror@gmx.de>
* java/nio/Buffer.java
(hasRemaining): Made implementation more clear.
* java/nio/MappedByteBuffer.java
(loaded): New member variable.
(force): Added comment.
(isLoaded): Return value of loaded.
(load): Set loaded to true, added comment.
2003-10-12 Michael Koch <konqueror@gmx.de> 2003-10-12 Michael Koch <konqueror@gmx.de>
* gnu/java/nio/PipeImpl.java * gnu/java/nio/PipeImpl.java
......
/* Buffer.java -- /* Buffer.java --
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -102,7 +102,7 @@ public abstract class Buffer ...@@ -102,7 +102,7 @@ public abstract class Buffer
*/ */
public final boolean hasRemaining () public final boolean hasRemaining ()
{ {
return limit > pos; return remaining() > 0;
} }
/** /**
......
...@@ -44,6 +44,8 @@ package java.nio; ...@@ -44,6 +44,8 @@ package java.nio;
*/ */
public abstract class MappedByteBuffer extends ByteBuffer public abstract class MappedByteBuffer extends ByteBuffer
{ {
private boolean loaded = false;
MappedByteBuffer (int capacity, int limit, int position, int mark) MappedByteBuffer (int capacity, int limit, int position, int mark)
{ {
super (capacity, limit, position, mark); super (capacity, limit, position, mark);
...@@ -51,16 +53,19 @@ public abstract class MappedByteBuffer extends ByteBuffer ...@@ -51,16 +53,19 @@ public abstract class MappedByteBuffer extends ByteBuffer
public final MappedByteBuffer force () public final MappedByteBuffer force ()
{ {
// FIXME: Flush to disk here.
return this; return this;
} }
public final boolean isLoaded () public final boolean isLoaded ()
{ {
return true; return loaded;
} }
public final MappedByteBuffer load () public final MappedByteBuffer load ()
{ {
// FIXME: Try to load all pages into memory.
loaded = true;
return this; return this;
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment