home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / java / nio / MappedByteBuffer.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  888 b   |  53 lines

  1. package java.nio;
  2.  
  3. public abstract class MappedByteBuffer extends ByteBuffer {
  4.    volatile boolean isAMappedBuffer;
  5.  
  6.    MappedByteBuffer(int var1, int var2, int var3, int var4, boolean var5) {
  7.       super(var1, var2, var3, var4);
  8.       this.isAMappedBuffer = var5;
  9.    }
  10.  
  11.    MappedByteBuffer(int var1, int var2, int var3, int var4) {
  12.       super(var1, var2, var3, var4);
  13.       this.isAMappedBuffer = false;
  14.    }
  15.  
  16.    private void checkMapped() {
  17.       if (!this.isAMappedBuffer) {
  18.          throw new UnsupportedOperationException();
  19.       }
  20.    }
  21.  
  22.    public final boolean isLoaded() {
  23.       this.checkMapped();
  24.       return this.address != 0L && this.capacity() != 0 ? this.isLoaded0(((DirectByteBuffer)this).address(), (long)this.capacity()) : true;
  25.    }
  26.  
  27.    public final MappedByteBuffer load() {
  28.       this.checkMapped();
  29.       if (this.address != 0L && this.capacity() != 0) {
  30.          this.load0(((DirectByteBuffer)this).address(), (long)this.capacity(), Bits.pageSize());
  31.          return this;
  32.       } else {
  33.          return this;
  34.       }
  35.    }
  36.  
  37.    public final MappedByteBuffer force() {
  38.       this.checkMapped();
  39.       if (this.address != 0L && this.capacity() != 0) {
  40.          this.force0(((DirectByteBuffer)this).address(), (long)this.capacity());
  41.          return this;
  42.       } else {
  43.          return this;
  44.       }
  45.    }
  46.  
  47.    private native boolean isLoaded0(long var1, long var3);
  48.  
  49.    private native int load0(long var1, long var3, int var5);
  50.  
  51.    private native void force0(long var1, long var3);
  52. }
  53.