package com.codeminders.ardrone.video;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.nio.ByteBuffer;
{
private int base2;
public uint(
byte[] bp,
int start)
{
try
{
byte[] b = new byte[4];
b[0] = bp[start + 3];
b[1] = bp[start + 2];
b[2] = bp[start + 1];
b[3] = bp[start + 0];
ByteArrayInputStream bas = new ByteArrayInputStream(b);
DataInputStream din = new DataInputStream(bas);
this.base2 = din.readInt();
} catch(Exception e)
{
throw new RuntimeException("error creating uint", e);
}
}
public uint(ByteBuffer bp,
int start)
{
try
{
ByteBuffer bb = ByteBuffer.allocate(4);
bb.put(bp.array()[start + 3]);
bb.put(bp.array()[start + 2]);
bb.put(bp.array()[start + 1]);
bb.put(bp.array()[start + 0]);
bb.flip();
this.base2 = bb.getInt();
}
catch(Exception e)
{
throw new RuntimeException("error creating uint", e);
}
}
{
this.base2 = base;
}
{
this.base2 = that.base2;
}
public uint
and(
int andval)
{
int retval = base2 & andval;
return new uint(retval);
}
{
int base = ~base2;
return base;
}
{
return base2;
}
public uint
or(uint orval)
{
int retval = base2 | orval.base2;
return new uint(retval);
}
{
int base = base2;
base <<= i;
return new uint(base);
}
{
int base = base2;
base <<= i;
base2 = base;
}
{
int base = base2;
base = base >>> i;
return new uint(base);
}
{
int base = base2;
base >>>= i;
base2 = base;
}
public short times(
short i)
{
return (short) (intValue() * i);
}
{
return Integer.toString(base2, 2);
}
}