private void ensureBounds(int l) throws IOException { while (buf.length < (pos + l)) { if (blockStack[stackTop].state == BlockedValue.State.REGULAR) { compact(); } else { super.writeFixed(buf, 0, pos); pos = 0; } } }
private void ensureBounds(int l) throws IOException { while (buf.length < (pos + l)) { if (blockStack[stackTop].state == BlockedValue.State.REGULAR) { compact(); } else { super.writeFixed(buf, 0, pos); pos = 0; } } }
private void write(byte[] b, int off, int len) throws IOException { if (blockStack[stackTop].state == BlockedValue.State.ROOT) { super.writeFixed(b, off, len); } else { assert check(); while (buf.length < (pos + len)) { if (blockStack[stackTop].state == BlockedValue.State.REGULAR) { compact(); } else { super.writeFixed(buf, 0, pos); pos = 0; if (buf.length <= len) { super.writeFixed(b, off, len); len = 0; } } } System.arraycopy(b, off, buf, pos, len); pos += len; } assert check(); }
private void write(byte[] b, int off, int len) throws IOException { if (blockStack[stackTop].state == BlockedValue.State.ROOT) { super.writeFixed(b, off, len); } else { assert check(); while (buf.length < (pos + len)) { if (blockStack[stackTop].state == BlockedValue.State.REGULAR) { compact(); } else { super.writeFixed(buf, 0, pos); pos = 0; if (buf.length <= len) { super.writeFixed(b, off, len); len = 0; } } } System.arraycopy(b, off, buf, pos, len); pos += len; } assert check(); }
/** * Called when we've finished writing the last item in an overflow * buffer. When this is finished, the top of the stack will be * an empty block in the "regular" state. * @throws IOException */ private void finishOverflow() throws IOException { BlockedValue s = blockStack[stackTop]; if (s.state != BlockedValue.State.OVERFLOW) { throw new IllegalStateException("Not an overflow block"); } assert check(); // Flush any remaining data for this block super.writeFixed(buf, 0, pos); pos = 0; // Reset top of stack to be in REGULAR mode s.state = BlockedValue.State.REGULAR; s.start = s.lastFullItem = 0; s.items = 0; assert check(); }
/** * Called when we've finished writing the last item in an overflow * buffer. When this is finished, the top of the stack will be * an empty block in the "regular" state. * @throws IOException */ private void finishOverflow() throws IOException { BlockedValue s = blockStack[stackTop]; if (s.state != BlockedValue.State.OVERFLOW) { throw new IllegalStateException("Not an overflow block"); } assert check(); // Flush any remaining data for this block super.writeFixed(buf, 0, pos); pos = 0; // Reset top of stack to be in REGULAR mode s.state = BlockedValue.State.REGULAR; s.start = s.lastFullItem = 0; s.items = 0; assert check(); }
super.writeFixed(buf, 0, s.start); super.writeInt(-(s.items - 1)); super.writeInt(s.lastFullItem - s.start); super.writeFixed(buf, s.start, s.lastFullItem - s.start); s.start = s.lastFullItem; s.items = 1; blockStack[i + 1] : null); int end = (n == null ? pos : n.start); super.writeFixed(buf, s.lastFullItem, end - s.lastFullItem);
@Override public void flush() throws IOException { BlockedValue bv = blockStack[stackTop]; if (bv.state == BlockedValue.State.ROOT) { super.writeFixed(buf, 0, pos); pos = 0; } else { while (bv.state != BlockedValue.State.OVERFLOW) { compact(); } } super.flush(); assert check(); }
super.writeFixed(buf, 0, s.start); super.writeInt(-(s.items - 1)); super.writeInt(s.lastFullItem - s.start); super.writeFixed(buf, s.start, s.lastFullItem - s.start); s.start = s.lastFullItem; s.items = 1; blockStack[i + 1] : null); int end = (n == null ? pos : n.start); super.writeFixed(buf, s.lastFullItem, end - s.lastFullItem);
@Override public void flush() throws IOException { BlockedValue bv = blockStack[stackTop]; if (bv.state == BlockedValue.State.ROOT) { super.writeFixed(buf, 0, pos); pos = 0; } else { while (bv.state != BlockedValue.State.OVERFLOW) { compact(); } } super.flush(); assert check(); }
private void ensureBounds(int l) throws IOException { while (buf.length < (pos + l)) { if (blockStack[stackTop].state == BlockedValue.State.REGULAR) { compact(); } else { super.writeFixed(buf, 0, pos); pos = 0; } } }
private void ensureBounds(int l) throws IOException { while (buf.length < (pos + l)) { if (blockStack[stackTop].state == BlockedValue.State.REGULAR) { compact(); } else { super.writeFixed(buf, 0, pos); pos = 0; } } }
private void write(byte[] b, int off, int len) throws IOException { if (blockStack[stackTop].state == BlockedValue.State.ROOT) { super.writeFixed(b, off, len); } else { assert check(); while (buf.length < (pos + len)) { if (blockStack[stackTop].state == BlockedValue.State.REGULAR) { compact(); } else { super.writeFixed(buf, 0, pos); pos = 0; if (buf.length <= len) { super.writeFixed(b, off, len); len = 0; } } } System.arraycopy(b, off, buf, pos, len); pos += len; } assert check(); }
private void write(byte[] b, int off, int len) throws IOException { if (blockStack[stackTop].state == BlockedValue.State.ROOT) { super.writeFixed(b, off, len); } else { assert check(); while (buf.length < (pos + len)) { if (blockStack[stackTop].state == BlockedValue.State.REGULAR) { compact(); } else { super.writeFixed(buf, 0, pos); pos = 0; if (buf.length <= len) { super.writeFixed(b, off, len); len = 0; } } } System.arraycopy(b, off, buf, pos, len); pos += len; } assert check(); }
/** * Called when we've finished writing the last item in an overflow * buffer. When this is finished, the top of the stack will be * an empty block in the "regular" state. * @throws IOException */ private void finishOverflow() throws IOException { BlockedValue s = blockStack[stackTop]; if (s.state != BlockedValue.State.OVERFLOW) { throw new IllegalStateException("Not an overflow block"); } assert check(); // Flush any remaining data for this block super.writeFixed(buf, 0, pos); pos = 0; // Reset top of stack to be in REGULAR mode s.state = BlockedValue.State.REGULAR; s.start = s.lastFullItem = 0; s.items = 0; assert check(); }
/** * Called when we've finished writing the last item in an overflow * buffer. When this is finished, the top of the stack will be * an empty block in the "regular" state. * @throws IOException */ private void finishOverflow() throws IOException { BlockedValue s = blockStack[stackTop]; if (s.state != BlockedValue.State.OVERFLOW) { throw new IllegalStateException("Not an overflow block"); } assert check(); // Flush any remaining data for this block super.writeFixed(buf, 0, pos); pos = 0; // Reset top of stack to be in REGULAR mode s.state = BlockedValue.State.REGULAR; s.start = s.lastFullItem = 0; s.items = 0; assert check(); }
super.writeFixed(buf, 0, s.start); super.writeInt(-(s.items - 1)); super.writeInt(s.lastFullItem - s.start); super.writeFixed(buf, s.start, s.lastFullItem - s.start); s.start = s.lastFullItem; s.items = 1; blockStack[i + 1] : null); int end = (n == null ? pos : n.start); super.writeFixed(buf, s.lastFullItem, end - s.lastFullItem);
super.writeFixed(buf, 0, s.start); super.writeInt(-(s.items - 1)); super.writeInt(s.lastFullItem - s.start); super.writeFixed(buf, s.start, s.lastFullItem - s.start); s.start = s.lastFullItem; s.items = 1; blockStack[i + 1] : null); int end = (n == null ? pos : n.start); super.writeFixed(buf, s.lastFullItem, end - s.lastFullItem);
@Override public void flush() throws IOException { BlockedValue bv = blockStack[stackTop]; if (bv.state == BlockedValue.State.ROOT) { super.writeFixed(buf, 0, pos); pos = 0; } else { while (bv.state != BlockedValue.State.OVERFLOW) { compact(); } } super.flush(); assert check(); }
@Override public void flush() throws IOException { BlockedValue bv = blockStack[stackTop]; if (bv.state == BlockedValue.State.ROOT) { super.writeFixed(buf, 0, pos); pos = 0; } else { while (bv.state != BlockedValue.State.OVERFLOW) { compact(); } } super.flush(); assert check(); }