diff options
Diffstat (limited to 'libjava/java')
-rw-r--r-- | libjava/java/nio/Buffer.java | 4 | ||||
-rw-r--r-- | libjava/java/nio/MappedByteBuffer.java | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/libjava/java/nio/Buffer.java b/libjava/java/nio/Buffer.java index 9221d75..444d3d1 100644 --- a/libjava/java/nio/Buffer.java +++ b/libjava/java/nio/Buffer.java @@ -1,5 +1,5 @@ /* Buffer.java -- - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -102,7 +102,7 @@ public abstract class Buffer */ public final boolean hasRemaining () { - return limit > pos; + return remaining() > 0; } /** diff --git a/libjava/java/nio/MappedByteBuffer.java b/libjava/java/nio/MappedByteBuffer.java index 87500e7..8f4b872 100644 --- a/libjava/java/nio/MappedByteBuffer.java +++ b/libjava/java/nio/MappedByteBuffer.java @@ -44,6 +44,8 @@ package java.nio; */ public abstract class MappedByteBuffer extends ByteBuffer { + private boolean loaded = false; + MappedByteBuffer (int capacity, int limit, int position, int mark) { super (capacity, limit, position, mark); @@ -51,16 +53,19 @@ public abstract class MappedByteBuffer extends ByteBuffer public final MappedByteBuffer force () { + // FIXME: Flush to disk here. return this; } public final boolean isLoaded () { - return true; + return loaded; } public final MappedByteBuffer load () { + // FIXME: Try to load all pages into memory. + loaded = true; return this; } } |