/** * insert the byte content into XML * @param offset (in char, not byte) * @param content * */ public void insertBytesAt(int offset, byte[] content) throws ModifyException{ if (insertHash.isUnique(offset)==false){ throw new ModifyException("There can be only one insert per offset"); } flb.append( (long)offset | MASK_INSERT_BYTE); fob.append(content); }
o = fob.objectAt(i); flb.modifyEntry(i,flb.longAt(j)); fob.modifyEntry(i,fob.objectAt(j)); flb.modifyEntry(j,h); fob.modifyEntry(j,o); i++; j--;
docSize -= (int) ((l & (0x1fffffffffffffffL))>> 32); } else if ((l & (~0x1fffffffffffffffL)) == MASK_INSERT_BYTE){ docSize += ((byte[])fob.objectAt(i)).length; } else if ((l & (~0x1fffffffffffffffL)) == MASK_INSERT_SEGMENT_BYTE){ docSize += ((ByteSegment)fob.objectAt(i)).len; } else if ((l & (~0x1fffffffffffffffL)) == MASK_INSERT_FRAGMENT_NS) { docSize += ((ElementFragmentNs)fob.objectAt(i)).getSize(md.encoding); } else if ((l & (~0x1fffffffffffffffL)) == MASK_INSERT_BYTE_ENCLOSED){ docSize += ((byte[])fob.objectAt(i)).length+inc; } else if ((l & (~0x1fffffffffffffffL)) == MASK_INSERT_SEGMENT_BYTE_ENCLOSED){ docSize += ((ByteSegment)fob.objectAt(i)).len+inc; } else if ((l & (~0x1fffffffffffffffL)) == MASK_INSERT_FRAGMENT_NS_ENCLOSED) { docSize += ((ElementFragmentNs)fob.objectAt(i)).getSize(md.encoding)+inc;
md = masterDocument; flb = new FastLongBuffer(); fob = new FastObjectBuffer(); int i = intHash.determineHashWidth(md.vtdSize); insertHash = new intHash(i);
docSize -= (int) ((l & (0x1fffffffffffffffL))>> 32); } else if ((l & (~0x1fffffffffffffffL)) == MASK_INSERT_BYTE){ docSize += ((byte[])fob.objectAt(i)).length; } else if ((l & (~0x1fffffffffffffffL)) == MASK_INSERT_SEGMENT_BYTE){ docSize += ((ByteSegment)fob.objectAt(i)).len; } else if ((l & (~0x1fffffffffffffffL)) == MASK_INSERT_FRAGMENT_NS) { docSize += ((ElementFragmentNs)fob.objectAt(i)).getSize(md.encoding); } else if ((l & (~0x1fffffffffffffffL)) == MASK_INSERT_BYTE_ENCLOSED){ docSize += ((byte[])fob.objectAt(i)).length+inc; } else if ((l & (~0x1fffffffffffffffL)) == MASK_INSERT_SEGMENT_BYTE_ENCLOSED){ docSize += ((ByteSegment)fob.objectAt(i)).len+inc; } else if ((l & (~0x1fffffffffffffffL)) == MASK_INSERT_FRAGMENT_NS_ENCLOSED) { docSize += ((ElementFragmentNs)fob.objectAt(i)).getSize(md.encoding)+inc;
md = masterDocument; flb = new FastLongBuffer(); fob = new FastObjectBuffer(); int i = intHash.determineHashWidth(md.vtdSize); insertHash = new intHash(i);
/** * Insert ns compensated element fragment into the document * @param ef * */ private void insertElementFragmentNsAt(int offset, ElementFragmentNs ef) throws ModifyException{ if (insertHash.isUnique(offset)==false){ throw new ModifyException("There can be only one insert per offset"); } flb.append((long)offset | MASK_INSERT_FRAGMENT_NS); fob.append(ef); }
o = fob.objectAt(i); flb.modifyEntry(i,flb.longAt(j)); fob.modifyEntry(i,fob.objectAt(j)); flb.modifyEntry(j,h); fob.modifyEntry(j,o); i++; j--;
docSize -= (int) ((l & (0x1fffffffffffffffL))>> 32); } else if ((l & (~0x1fffffffffffffffL)) == MASK_INSERT_BYTE){ docSize += ((byte[])fob.objectAt(i)).length; } else if ((l & (~0x1fffffffffffffffL)) == MASK_INSERT_SEGMENT_BYTE){ docSize += ((ByteSegment)fob.objectAt(i)).len; } else if ((l & (~0x1fffffffffffffffL)) == MASK_INSERT_FRAGMENT_NS) { docSize += ((ElementFragmentNs)fob.objectAt(i)).getSize(md.encoding); } else if ((l & (~0x1fffffffffffffffL)) == MASK_INSERT_BYTE_ENCLOSED){ docSize += ((byte[])fob.objectAt(i)).length+inc; } else if ((l & (~0x1fffffffffffffffL)) == MASK_INSERT_SEGMENT_BYTE_ENCLOSED){ docSize += ((ByteSegment)fob.objectAt(i)).len+inc; } else if ((l & (~0x1fffffffffffffffL)) == MASK_INSERT_FRAGMENT_NS_ENCLOSED) { docSize += ((ElementFragmentNs)fob.objectAt(i)).getSize(md.encoding)+inc;
md = masterDocument; flb = new FastLongBuffer(); fob = new FastObjectBuffer(); int i = intHash.determineHashWidth(md.vtdSize); insertHash = new intHash(i);
private void insertElementFragmentNsEnclosedAt(int offset, ElementFragmentNs ef) throws ModifyException{ if (insertHash.isUnique(offset)==false){ throw new ModifyException("There can be only one insert per offset"); } flb.append((long)offset | MASK_INSERT_FRAGMENT_NS_ENCLOSED); fob.append(ef); }
o = fob.objectAt(i); flb.modifyEntry(i,flb.longAt(j)); fob.modifyEntry(i,fob.objectAt(j)); flb.modifyEntry(j,h); fob.modifyEntry(j,o); i++; j--;
} else if ((l & (~0x1fffffffffffffffL)) == MASK_INSERT_BYTE) { // insert os.write(ba, offset, flb.lower32At(i) - offset); os.write((byte[]) fob.objectAt(i)); offset = flb.lower32At(i); } else if ((l & (~0x1fffffffffffffffL)) == MASK_INSERT_SEGMENT_BYTE) { ByteSegment bs = (ByteSegment) fob.objectAt(i); os.write(bs.ba, bs.offset, bs.len); offset = flb.lower32At(i); .objectAt(i); ef.writeToOutputStream(os, md.encoding); offset = flb.lower32At(i); os.write(ba, offset, flb.lower32At(i) - offset); os.write(0x3e); os.write((byte[]) fob.objectAt(i)); os.write(0x3c); offset = flb.lower32At(i); ByteSegment bs = (ByteSegment) fob.objectAt(i); os.write(0x3e); os.write(bs.ba, bs.offset, bs.len); .objectAt(i); os.write(0x3e); ef.writeToOutputStream(os, md.encoding); os.write((byte[]) fob.objectAt(i2));
private void insertElementFragmentNsEnclosedAt(int offset, ElementFragmentNs ef) throws ModifyException{ if (insertHash.isUnique(offset)==false){ throw new ModifyException("There can be only one insert per offset"); } flb.append((long)offset | MASK_INSERT_FRAGMENT_NS_ENCLOSED); fob.append(ef); }
} else if ((l & (~0x1fffffffffffffffL)) == MASK_INSERT_BYTE) { // insert os.write(ba, offset, flb.lower32At(i) - offset); os.write((byte[]) fob.objectAt(i)); offset = flb.lower32At(i); } else if ((l & (~0x1fffffffffffffffL)) == MASK_INSERT_SEGMENT_BYTE) { ByteSegment bs = (ByteSegment) fob.objectAt(i); os.write(bs.ba, bs.offset, bs.len); offset = flb.lower32At(i); .objectAt(i); ef.writeToOutputStream(os, md.encoding); offset = flb.lower32At(i); os.write(ba, offset, flb.lower32At(i) - offset); os.write(0x3e); os.write((byte[]) fob.objectAt(i)); os.write(0x3c); offset = flb.lower32At(i); ByteSegment bs = (ByteSegment) fob.objectAt(i); os.write(0x3e); os.write(bs.ba, bs.offset, bs.len); .objectAt(i); os.write(0x3e); ef.writeToOutputStream(os, md.encoding); os.write((byte[]) fob.objectAt(i2));
/** * insert the byte content into XML * @param offset (in char, not byte) * @param content * */ public void insertBytesAt(int offset, byte[] content) throws ModifyException{ if (insertHash.isUnique(offset)==false){ throw new ModifyException("There can be only one insert per offset"); } flb.append( (long)offset | MASK_INSERT_BYTE); fob.append(content); }
} else if ((l & (~0x1fffffffffffffffL)) == MASK_INSERT_BYTE) { // insert os.write(ba, offset, flb.lower32At(i) - offset); os.write((byte[]) fob.objectAt(i)); offset = flb.lower32At(i); } else if ((l & (~0x1fffffffffffffffL)) == MASK_INSERT_SEGMENT_BYTE) { ByteSegment bs = (ByteSegment) fob.objectAt(i); os.write(bs.ba, bs.offset, bs.len); offset = flb.lower32At(i); .objectAt(i); ef.writeToOutputStream(os, md.encoding); offset = flb.lower32At(i); os.write(ba, offset, flb.lower32At(i) - offset); os.write(0x3e); os.write((byte[]) fob.objectAt(i)); os.write(0x3c); offset = flb.lower32At(i); ByteSegment bs = (ByteSegment) fob.objectAt(i); os.write(0x3e); os.write(bs.ba, bs.offset, bs.len); .objectAt(i); os.write(0x3e); ef.writeToOutputStream(os, md.encoding); os.write((byte[]) fob.objectAt(i2));
/** * Insert ns compensated element fragment into the document * @param ef * */ private void insertElementFragmentNsAt(int offset, ElementFragmentNs ef) throws ModifyException{ if (insertHash.isUnique(offset)==false){ throw new ModifyException("There can be only one insert per offset"); } flb.append((long)offset | MASK_INSERT_FRAGMENT_NS); fob.append(ef); }
/** * Insert ns compensated element fragment into the document * @param ef * */ private void insertElementFragmentNsAt(int offset, ElementFragmentNs ef) throws ModifyException{ if (insertHash.isUnique(offset)==false){ throw new ModifyException("There can be only one insert per offset"); } flb.append((long)offset | MASK_INSERT_FRAGMENT_NS); fob.append(ef); }
private void insertElementFragmentNsEnclosedAt(int offset, ElementFragmentNs ef) throws ModifyException{ if (insertHash.isUnique(offset)==false){ throw new ModifyException("There can be only one insert per offset"); } flb.append((long)offset | MASK_INSERT_FRAGMENT_NS_ENCLOSED); fob.append(ef); }