// Helper functions for storing integer values into byte streams. // No bounds checking is performed, that is the responsibility of the caller. public static int StoreU32(byte[] dst, int offset, int x) { dst[offset] = JavaUnsignedUtil.ToU8(x >> 24); dst[offset + 1] = JavaUnsignedUtil.ToU8(x >> 16); dst[offset + 2] = JavaUnsignedUtil.ToU8(x >> 8); dst[offset + 3] = JavaUnsignedUtil.ToU8(x); return(offset + 4); }
public static int StoreU16(byte[] dst, int offset, int x) { dst[offset] = JavaUnsignedUtil.ToU8(x >> 8); dst[offset + 1] = JavaUnsignedUtil.ToU8(x); return(offset + 2); }
public virtual byte ReadByte() { return(JavaUnsignedUtil.ToU8(ReadAsNumber(1))); }