public void writeUINT32(int val, int off) { if ((off + 4) > arr.length) resize(off + 32); arr[off++] = (byte) (val >> 24); arr[off++] = (byte) (val >> 16); arr[off++] = (byte) (val >> 8); arr[off++] = (byte) val; }
public void writeUINT64(long val) { if ((pos + 8) > arr.length) resize(arr.length + 32); arr[pos++] = (byte) (val >> 56); arr[pos++] = (byte) (val >> 48); arr[pos++] = (byte) (val >> 40); arr[pos++] = (byte) (val >> 32); arr[pos++] = (byte) (val >> 24); arr[pos++] = (byte) (val >> 16); arr[pos++] = (byte) (val >> 8); arr[pos++] = (byte) val; }
public void writeBytes(byte[] buff, int off, int len) { if ((pos + len) > arr.length) resize(arr.length + len + 32); System.arraycopy(buff, off, arr, pos, len); pos += len; }
public void writeByte(int v, int off) { if ((off + 1) > arr.length) resize(off + 32); arr[off] = (byte) v; }
public void writeBoolean(boolean v) { if ((pos + 1) > arr.length) resize(arr.length + 32); arr[pos++] = v ? (byte) 1 : (byte) 0; }