/* NativeHeap - Decompiled by JODE
 * Visit http://jode.sourceforge.net/
 */
package jaclib.memory.heap;

public final class NativeHeap
{
    long peer;
    private int anInt424;
    private boolean aBool425;
    
    public NativeHeap(int i) {
	anInt424 = i * 591954621;
	allocateHeap(anInt424 * 871237781);
	aBool425 = true;
    }
    
    synchronized boolean method995() {
	return aBool425;
    }
    
    public NativeHeapBuffer method996(int i, boolean bool) {
	if (!aBool425)
	    throw new IllegalStateException();
	return new NativeHeapBuffer(this, allocateBuffer(i, bool), i);
    }
    
    public synchronized void method997() {
	if (aBool425)
	    deallocateHeap();
	aBool425 = false;
    }
    
    private native void allocateHeap(int i);
    
    private native void deallocateHeap();
    
    synchronized native int allocateBuffer(int i, boolean bool);
    
    synchronized native long getBufferAddress(int i);
    
    synchronized native void get(int i, byte[] is, int i_0_, int i_1_,
				 int i_2_);
    
    synchronized native void put(int i, byte[] is, int i_3_, int i_4_,
				 int i_5_);
    
    synchronized native void deallocateBuffer(int i);
    
    public synchronized native void copy(long l, long l_6_, int i);
    
    protected synchronized void finalize() throws Throwable {
	super.finalize();
	method997();
    }
    
    protected synchronized void method998() throws Throwable {
	super.finalize();
	method997();
    }
    
    synchronized boolean method999() {
	return aBool425;
    }
    
    public NativeHeapBuffer method1000(int i, boolean bool) {
	if (!aBool425)
	    throw new IllegalStateException();
	return new NativeHeapBuffer(this, allocateBuffer(i, bool), i);
    }
    
    public NativeHeapBuffer method1001(int i, boolean bool) {
	if (!aBool425)
	    throw new IllegalStateException();
	return new NativeHeapBuffer(this, allocateBuffer(i, bool), i);
    }
    
    public NativeHeapBuffer method1002(int i, boolean bool) {
	if (!aBool425)
	    throw new IllegalStateException();
	return new NativeHeapBuffer(this, allocateBuffer(i, bool), i);
    }
    
    public NativeHeapBuffer method1003(int i, boolean bool) {
	if (!aBool425)
	    throw new IllegalStateException();
	return new NativeHeapBuffer(this, allocateBuffer(i, bool), i);
    }
    
    public synchronized void method1004() {
	if (aBool425)
	    deallocateHeap();
	aBool425 = false;
    }
}
