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

public final class Stream
{
    private Buffer aBuffer912;
    private int anInt913;
    private int anInt914;
    private int anInt915;
    private byte[] aByteArray916;
    private static boolean aBool917 = getLSB(-65536) == -1;
    
    public Stream() {
	this(4096);
    }
    
    private Stream(int i) {
	aByteArray916 = new byte[i];
    }
    
    public Stream(Buffer buffer) {
	this(buffer, 0, buffer.method1());
    }
    
    private Stream(Buffer buffer, int i, int i_0_) {
	this(buffer.method1() < 4096 ? buffer.method1() : 4096);
	method1033(buffer, i, i_0_);
    }
    
    private void method1033(Buffer buffer, int i, int i_1_) {
	method1039();
	aBuffer912 = buffer;
	anInt914 = -1526597541 * i;
	anInt913 = -1180201775 * (i + i_1_);
	if (-283096015 * anInt913 > buffer.method1())
	    throw new RuntimeException();
    }
    
    public int method1034() {
	return anInt914 * -500533293 + anInt915 * -186121295;
    }
    
    public void method1035(int i) {
	method1039();
	anInt914 = -1526597541 * i;
    }
    
    public void method1036(int i) {
	if (anInt915 * -186121295 >= aByteArray916.length)
	    method1039();
	aByteArray916[(anInt915 += 1036150097) * -186121295 - 1] = (byte) i;
    }
    
    public void method1037(float f) {
	if (anInt915 * -186121295 + 3 >= aByteArray916.length)
	    method1039();
	int i = floatToRawIntBits(f);
	aByteArray916[(anInt915 += 1036150097) * -186121295 - 1]
	    = (byte) (i >> 24);
	aByteArray916[(anInt915 += 1036150097) * -186121295 - 1]
	    = (byte) (i >> 16);
	aByteArray916[(anInt915 += 1036150097) * -186121295 - 1]
	    = (byte) (i >> 8);
	aByteArray916[(anInt915 += 1036150097) * -186121295 - 1] = (byte) i;
    }
    
    public void method1038(float f) {
	if (3 + anInt915 * -186121295 >= aByteArray916.length)
	    method1039();
	int i = floatToRawIntBits(f);
	aByteArray916[(anInt915 += 1036150097) * -186121295 - 1] = (byte) i;
	aByteArray916[(anInt915 += 1036150097) * -186121295 - 1]
	    = (byte) (i >> 8);
	aByteArray916[(anInt915 += 1036150097) * -186121295 - 1]
	    = (byte) (i >> 16);
	aByteArray916[(anInt915 += 1036150097) * -186121295 - 1]
	    = (byte) (i >> 24);
    }
    
    public void method1039() {
	if (anInt915 * -186121295 > 0) {
	    if (-500533293 * anInt914 + -186121295 * anInt915
		> anInt913 * -283096015)
		throw new RuntimeException();
	    aBuffer912.method3(aByteArray916, 0, anInt914 * -500533293,
			       anInt915 * -186121295);
	    anInt914 += -356661269 * anInt915;
	    anInt915 = 0;
	}
    }
    
    public static final boolean method1040() {
	return aBool917;
    }
    
    public static native int floatToRawIntBits(float f);
    
    private static final native byte getLSB(int i);
    
    public void method1041(int i) {
	method1039();
	anInt914 = -1526597541 * i;
    }
    
    public void method1042(int i) {
	method1039();
	anInt914 = -1526597541 * i;
    }
    
    public void method1043(int i) {
	method1039();
	anInt914 = -1526597541 * i;
    }
    
    public void method1044(int i) {
	method1039();
	anInt914 = -1526597541 * i;
    }
    
    public void method1045(int i) {
	if (anInt915 * -186121295 >= aByteArray916.length)
	    method1039();
	aByteArray916[(anInt915 += 1036150097) * -186121295 - 1] = (byte) i;
    }
    
    public void method1046(int i) {
	if (anInt915 * -186121295 >= aByteArray916.length)
	    method1039();
	aByteArray916[(anInt915 += 1036150097) * -186121295 - 1] = (byte) i;
    }
    
    public void method1047(int i) {
	if (anInt915 * -186121295 >= aByteArray916.length)
	    method1039();
	aByteArray916[(anInt915 += 1036150097) * -186121295 - 1] = (byte) i;
    }
    
    public void method1048(int i) {
	if (anInt915 * -186121295 >= aByteArray916.length)
	    method1039();
	aByteArray916[(anInt915 += 1036150097) * -186121295 - 1] = (byte) i;
    }
    
    public void method1049(float f) {
	if (anInt915 * -186121295 + 3 >= aByteArray916.length)
	    method1039();
	int i = floatToRawIntBits(f);
	aByteArray916[(anInt915 += 1036150097) * -186121295 - 1]
	    = (byte) (i >> 24);
	aByteArray916[(anInt915 += 1036150097) * -186121295 - 1]
	    = (byte) (i >> 16);
	aByteArray916[(anInt915 += 1036150097) * -186121295 - 1]
	    = (byte) (i >> 8);
	aByteArray916[(anInt915 += 1036150097) * -186121295 - 1] = (byte) i;
    }
    
    public void method1050(float f) {
	if (anInt915 * -186121295 + 3 >= aByteArray916.length)
	    method1039();
	int i = floatToRawIntBits(f);
	aByteArray916[(anInt915 += 1036150097) * -186121295 - 1]
	    = (byte) (i >> 24);
	aByteArray916[(anInt915 += 1036150097) * -186121295 - 1]
	    = (byte) (i >> 16);
	aByteArray916[(anInt915 += 1036150097) * -186121295 - 1]
	    = (byte) (i >> 8);
	aByteArray916[(anInt915 += 1036150097) * -186121295 - 1] = (byte) i;
    }
    
    public void method1051() {
	if (anInt915 * -186121295 > 0) {
	    if (-500533293 * anInt914 + -186121295 * anInt915
		> anInt913 * -283096015)
		throw new RuntimeException();
	    aBuffer912.method3(aByteArray916, 0, anInt914 * -500533293,
			       anInt915 * -186121295);
	    anInt914 += -356661269 * anInt915;
	    anInt915 = 0;
	}
    }
    
    public void method1052() {
	if (anInt915 * -186121295 > 0) {
	    if (-500533293 * anInt914 + -186121295 * anInt915
		> anInt913 * -283096015)
		throw new RuntimeException();
	    aBuffer912.method3(aByteArray916, 0, anInt914 * -500533293,
			       anInt915 * -186121295);
	    anInt914 += -356661269 * anInt915;
	    anInt915 = 0;
	}
    }
    
    public static final boolean method1053() {
	return aBool917;
    }
}
