@Override public void write(int b) { append(b); }
/** * @since 2.9 */ public void appendFourBytes(int b32) { if ((_currBlockPtr + 3) < _currBlock.length) { _currBlock[_currBlockPtr++] = (byte) (b32 >> 24); _currBlock[_currBlockPtr++] = (byte) (b32 >> 16); _currBlock[_currBlockPtr++] = (byte) (b32 >> 8); _currBlock[_currBlockPtr++] = (byte) b32; } else { append(b32 >> 24); append(b32 >> 16); append(b32 >> 8); append(b32); } }
@Override public void write(int b) { append(b); }
/** * @since 2.9 */ public void appendFourBytes(int b32) { if ((_currBlockPtr + 3) < _currBlock.length) { _currBlock[_currBlockPtr++] = (byte) (b32 >> 24); _currBlock[_currBlockPtr++] = (byte) (b32 >> 16); _currBlock[_currBlockPtr++] = (byte) (b32 >> 8); _currBlock[_currBlockPtr++] = (byte) b32; } else { append(b32 >> 24); append(b32 >> 16); append(b32 >> 8); append(b32); } }
private int _appendByte(int ch, int esc, ByteArrayBuilder bb, int ptr) { bb.setCurrentSegmentLength(ptr); bb.append('\\'); if (esc < 0) { // standard escape bb.append('u'); if (ch > 0xFF) { int hi = (ch >> 8); bb.append(HB[hi >> 4]); bb.append(HB[hi & 0xF]); ch &= 0xFF; } else { bb.append('0'); bb.append('0'); } bb.append(HB[ch >> 4]); bb.append(HB[ch & 0xF]); } else { // 2-char simple escape bb.append((byte) esc); } return bb.getCurrentSegmentLength(); }
private int _appendByte(int ch, int esc, ByteArrayBuilder bb, int ptr) { bb.setCurrentSegmentLength(ptr); bb.append('\\'); if (esc < 0) { // standard escape bb.append('u'); if (ch > 0xFF) { int hi = (ch >> 8); bb.append(HB[hi >> 4]); bb.append(HB[hi & 0xF]); ch &= 0xFF; } else { bb.append('0'); bb.append('0'); } bb.append(HB[ch >> 4]); bb.append(HB[ch & 0xF]); } else { // 2-char simple escape bb.append((byte) esc); } return bb.getCurrentSegmentLength(); }