/** Append byte to this buffer. */ public void appendByte(int b) { if (length >= elems.length) copy(elems.length * 2); elems[length++] = (byte)b; }
/** Append a character as a two byte number. */ public void appendChar(int x) { while (length + 1 >= elems.length) copy(elems.length * 2); elems[length ] = (byte)((x >> 8) & 0xFF); elems[length+1] = (byte)((x ) & 0xFF); length = length + 2; }
/** Append an integer as a four byte number. */ public void appendInt(int x) { while (length + 3 >= elems.length) copy(elems.length * 2); elems[length ] = (byte)((x >> 24) & 0xFF); elems[length+1] = (byte)((x >> 16) & 0xFF); elems[length+2] = (byte)((x >> 8) & 0xFF); elems[length+3] = (byte)((x ) & 0xFF); length = length + 4; }
/** Append an integer as a four byte number. */ public void appendInt(int x) { while (length + 3 >= elems.length) copy(elems.length * 2); elems[length ] = (byte)((x >> 24) & 0xFF); elems[length+1] = (byte)((x >> 16) & 0xFF); elems[length+2] = (byte)((x >> 8) & 0xFF); elems[length+3] = (byte)((x ) & 0xFF); length = length + 4; }
/** Append a character as a two byte number. */ public void appendChar(int x) { while (length + 1 >= elems.length) copy(elems.length * 2); elems[length ] = (byte)((x >> 8) & 0xFF); elems[length+1] = (byte)((x ) & 0xFF); length = length + 2; }
/** Append byte to this buffer. */ public void appendByte(int b) { if (length >= elems.length) copy(elems.length * 2); elems[length++] = (byte)b; }
/** Append `len' bytes from byte array, * starting at given `start' offset. */ public void appendBytes(byte[] bs, int start, int len) { while (length + len > elems.length) copy(elems.length * 2); System.arraycopy(bs, start, elems, length, len); length += len; }
/** Append `len' bytes from byte array, * starting at given `start' offset. */ public void appendBytes(byte[] bs, int start, int len) { while (length + len > elems.length) copy(elems.length * 2); System.arraycopy(bs, start, elems, length, len); length += len; }