private int insertByteBranch(int danglingByteCount, int pos, byte[] source, final int sourcePos, final int sourceLength, int sourceMask) { final int requiredRoom = SIZE_OF_END_1 + SIZE_OF_BRANCH + sourceLength + midRunEscapeValuesSizeAdjustment(source, sourcePos, sourceLength, sourceMask); final int oldValueIdx = makeRoomForInsert(danglingByteCount, pos, requiredRoom); byte c = source[sourcePos & sourceMask]; pos = writeBranch(TYPE_BRANCH_VALUE, pos, requiredRoom, findSingleBitMask((short) c, this.data[oldValueIdx])); return pos; }
private int insertBranch(int danglingByteCount, int pos, byte[] source, final int sourcePos, final int sourceLength, int sourceMask) { final int requiredRoom = SIZE_OF_END_1 + SIZE_OF_BRANCH + sourceLength + midRunEscapeValuesSizeAdjustment(source, sourcePos, sourceLength, sourceMask); //TODO: bad req room, add to end instead we do not know right length... final int oldValueIdx = makeRoomForInsert(danglingByteCount, pos, requiredRoom); return writeBranch(TYPE_BRANCH_VALUE, pos, requiredRoom, findSingleBitMask((short) source[sourcePos & sourceMask], this.data[oldValueIdx])); }
private int insertBranch(int danglingByteCount, int pos, byte[] source, final int sourcePos, final int sourceLength, int sourceMask) { final int requiredRoom = SIZE_OF_END_1 + SIZE_OF_BRANCH + sourceLength + midRunEscapeValuesSizeAdjustment(source, sourcePos, sourceLength, sourceMask); //TODO: bad req room, add to end instead we do not know right length... final int oldValueIdx = makeRoomForInsert(danglingByteCount, pos, requiredRoom); return writeBranch(TYPE_BRANCH_VALUE, pos, requiredRoom, findSingleBitMask((short) source[sourcePos & sourceMask], this.data[oldValueIdx])); }