diff options
Diffstat (limited to 'libjava/java/nio/MappedByteBuffer.java')
-rw-r--r-- | libjava/java/nio/MappedByteBuffer.java | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/libjava/java/nio/MappedByteBuffer.java b/libjava/java/nio/MappedByteBuffer.java index 8f4b872..29b0453 100644 --- a/libjava/java/nio/MappedByteBuffer.java +++ b/libjava/java/nio/MappedByteBuffer.java @@ -44,28 +44,46 @@ 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); } + void forceImpl() + { + } + public final MappedByteBuffer force () { - // FIXME: Flush to disk here. + forceImpl(); return this; } + boolean isLoadedImpl() + { + load(); + return true; + } + public final boolean isLoaded () { - return loaded; + return isLoadedImpl(); } + void loadImpl() + { + } + public final MappedByteBuffer load () { - // FIXME: Try to load all pages into memory. - loaded = true; + loadImpl(); return this; } + + void unmapImpl () + { + forceImpl(); + } + + public void finalize () { unmapImpl(); } } |