/* NativeHeapBuffer - Decompiled by JODE
 * Visit http://jode.sourceforge.net/
 */
package jaclib.memory.heap;
import jaclib.memory.Buffer;
import jaclib.memory.Source;

public final class NativeHeapBuffer implements Buffer, Source
{
    private int anInt886;
    public NativeHeap aNativeHeap887;
    private int anInt888;
    private boolean aBool889 = true;
    
    NativeHeapBuffer(NativeHeap nativeheap, int i, int i_0_) {
	aNativeHeap887 = nativeheap;
	anInt888 = 1855685403 * i;
	anInt886 = 2017517393 * i_0_;
    }
    
    private final synchronized boolean method1016() {
	return aNativeHeap887.method1208() && aBool889;
    }
    
    public final long method2() {
	return aNativeHeap887.getBufferAddress(1158618899 * anInt888);
    }
    
    public final int method1() {
	return -1860187727 * anInt886;
    }
    
    public final synchronized void method3(byte[] is, int i, int i_1_,
					   int i_2_) {
	if (!method1016() | is == null | i < 0 | i_2_ + i > is.length
	    | i_1_ < 0 | i_1_ + i_2_ > -1860187727 * anInt886)
	    throw new RuntimeException();
	aNativeHeap887.put(anInt888 * 1158618899, is, i, i_1_, i_2_);
    }
    
    public final synchronized void method1017() {
	if (method1016())
	    aNativeHeap887.deallocateBuffer(1158618899 * anInt888);
	aBool889 = false;
    }
    
    protected final synchronized void finalize() throws Throwable {
	super.finalize();
	method1017();
    }
    
    protected final synchronized void method1018() throws Throwable {
	super.finalize();
	method1017();
    }
    
    protected final synchronized void method1019() throws Throwable {
	super.finalize();
	method1017();
    }
    
    public final int method4() {
	return -1860187727 * anInt886;
    }
    
    public final int method5() {
	return -1860187727 * anInt886;
    }
    
    public final int method6() {
	return -1860187727 * anInt886;
    }
    
    public final int method7() {
	return -1860187727 * anInt886;
    }
    
    public final long method8() {
	return aNativeHeap887.getBufferAddress(1158618899 * anInt888);
    }
    
    public final long method9() {
	return aNativeHeap887.getBufferAddress(1158618899 * anInt888);
    }
    
    public final synchronized void method10(byte[] is, int i, int i_3_,
					    int i_4_) {
	if (!method1016() | is == null | i < 0 | i_4_ + i > is.length
	    | i_3_ < 0 | i_3_ + i_4_ > -1860187727 * anInt886)
	    throw new RuntimeException();
	aNativeHeap887.put(anInt888 * 1158618899, is, i, i_3_, i_4_);
    }
    
    private final synchronized boolean method1020() {
	return aNativeHeap887.method1208() && aBool889;
    }
    
    private final synchronized boolean method1021() {
	return aNativeHeap887.method1208() && aBool889;
    }
    
    private final synchronized boolean method1022() {
	return aNativeHeap887.method1208() && aBool889;
    }
    
    public final synchronized void method1023() {
	if (method1016())
	    aNativeHeap887.deallocateBuffer(1158618899 * anInt888);
	aBool889 = false;
    }
}
