@Override protected void writeZero() throws IOException { ensureBounds(1); buf[pos++] = (byte) 0; }
@Override protected void writeZero() throws IOException { ensureBounds(1); buf[pos++] = (byte) 0; }
private void doWriteBytes(byte[] bytes, int start, int len) throws IOException { if (len < buf.length) { ensureBounds(len); System.arraycopy(bytes, start, buf, pos, len); pos += len; } else { ensureBounds(buf.length); assert blockStack[stackTop].state == BlockedValue.State.ROOT || blockStack[stackTop].state == BlockedValue.State.OVERFLOW; write(bytes, start, len); } }
private void doWriteBytes(byte[] bytes, int start, int len) throws IOException { if (len < buf.length) { ensureBounds(len); System.arraycopy(bytes, start, buf, pos, len); pos += len; } else { ensureBounds(buf.length); assert blockStack[stackTop].state == BlockedValue.State.ROOT || blockStack[stackTop].state == BlockedValue.State.OVERFLOW; write(bytes, start, len); } }
@Override public void writeDouble(double d) throws IOException { ensureBounds(8); pos += BinaryData.encodeDouble(d, buf, pos); }
@Override public void writeIndex(int unionIndex) throws IOException { ensureBounds(5); pos += BinaryData.encodeInt(unionIndex, buf, pos); }
@Override public void writeInt(int n) throws IOException { ensureBounds(5); pos += BinaryData.encodeInt(n, buf, pos); }
@Override public void writeLong(long n) throws IOException { ensureBounds(10); pos += BinaryData.encodeLong(n, buf, pos); }
@Override public void writeInt(int n) throws IOException { ensureBounds(5); pos += BinaryData.encodeInt(n, buf, pos); }
@Override public void writeLong(long n) throws IOException { ensureBounds(10); pos += BinaryData.encodeLong(n, buf, pos); }
@Override public void writeFloat(float f) throws IOException { ensureBounds(4); pos += BinaryData.encodeFloat(f, buf, pos); }
@Override public void writeBoolean(boolean b) throws IOException { ensureBounds(1); pos += BinaryData.encodeBoolean(b, buf, pos); }
@Override public void writeBoolean(boolean b) throws IOException { ensureBounds(1); pos += BinaryData.encodeBoolean(b, buf, pos); }
@Override public void writeFloat(float f) throws IOException { ensureBounds(4); pos += BinaryData.encodeFloat(f, buf, pos); }
@Override public void writeDouble(double d) throws IOException { ensureBounds(8); pos += BinaryData.encodeDouble(d, buf, pos); }
@Override public void writeIndex(int unionIndex) throws IOException { ensureBounds(5); pos += BinaryData.encodeInt(unionIndex, buf, pos); }
ensureBounds(1); buf[pos++] = 0; // Sentinel for last block in a blocked value assert check();
ensureBounds(1); buf[pos++] = 0; // Sentinel for last block in a blocked value assert check();
private void doWriteBytes(byte[] bytes, int start, int len) throws IOException { if (len < buf.length) { ensureBounds(len); System.arraycopy(bytes, start, buf, pos, len); pos += len; } else { ensureBounds(buf.length); assert blockStack[stackTop].state == BlockedValue.State.ROOT || blockStack[stackTop].state == BlockedValue.State.OVERFLOW; write(bytes, start, len); } }
@Override public void writeFloat(float f) throws IOException { ensureBounds(4); pos += BinaryData.encodeFloat(f, buf, pos); }