/** * 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); }
/** * 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); }
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); }
/** * 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); }
/** * 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); }
/** * insert the byte content into XML and surround it with "<" and ">" * @param offset (in char, not byte) * @param content * */ private void insertBytesEnclosedAt(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_ENCLOSED); fob.append(content); }
/** * insert the byte content into XML and surround it with ">" and "<" * @param offset (in char, not byte) * @param content * */ private void insertBytesEnclosedAt(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_ENCLOSED); fob.append(content); }
/** * insert the byte content into XML and surround it with ">" and "<" * @param offset (in char, not byte) * @param content * */ private void insertBytesEnclosedAt(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_ENCLOSED); fob.append(content); }
/** * 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); }
/** * Remove a segment of byte content from master XML doc. * The segment is denoted by its offset and len. * @param offset * @param len * */ public void removeContent(int offset, int len) throws ModifyException{ if (offset < md.docOffset || len > md.docLen || offset + len > md.docOffset + md.docLen){ throw new ModifyException("Invalid offset or length for removeContent"); } if (deleteHash.isUnique(offset)==false) throw new ModifyException("There can be only one deletion per offset value"); while(len > (1<<29)-1){ flb.append(((long)((1<<29)-1))<<32 | offset | MASK_DELETE); fob.append((Object)null); len -= (1<<29)-1; offset += (1<<29)-1; } flb.append(((long)len)<<32 | offset | MASK_DELETE); fob.append((Object)null); }
/** * Remove a segment of byte content from master XML doc. * The segment is denoted by its offset and len. * @param offset * @param len * */ public void removeContent(int offset, int len) throws ModifyException{ if (offset < md.docOffset || len > md.docLen || offset + len > md.docOffset + md.docLen){ throw new ModifyException("Invalid offset or length for removeContent"); } if (deleteHash.isUnique(offset)==false) throw new ModifyException("There can be only one deletion per offset value"); while(len > (1<<29)-1){ flb.append(((long)((1<<29)-1))<<32 | offset | MASK_DELETE); fob.append((Object)null); len -= (1<<29)-1; offset += (1<<29)-1; } flb.append(((long)len)<<32 | offset | MASK_DELETE); fob.append((Object)null); }
/** * Remove a segment of byte content from master XML doc. * The segment is denoted by its offset and len. * @param offset * @param len * */ public void removeContent(int offset, int len) throws ModifyException{ if (offset < md.docOffset || len > md.docLen || offset + len > md.docOffset + md.docLen){ throw new ModifyException("Invalid offset or length for removeContent"); } if (deleteHash.isUnique(offset)==false) throw new ModifyException("There can be only one deletion per offset value"); while(len > (1<<29)-1){ flb.append(((long)((1<<29)-1))<<32 | offset | MASK_DELETE); fob.append((Object)null); len -= (1<<29)-1; offset += (1<<29)-1; } flb.append(((long)len)<<32 | offset | MASK_DELETE); fob.append((Object)null); }
private void insertBytesEnclosedAt(int offset, byte[] content, long l) throws ModifyException { if (insertHash.isUnique(offset)==false){ throw new ModifyException("There can be only one insert per offset"); } int contentOffset = (int)l; int contentLen = (int)(l>>32); if (contentOffset < 0 || contentLen <0 || contentOffset+contentLen > content.length){ throw new ModifyException("Invalid contentOffset and/or contentLen"); } flb.append( (long)offset | MASK_INSERT_SEGMENT_BYTE_ENCLOSED); ByteSegment bs = new ByteSegment(); bs.ba = content; bs.len = contentLen; bs.offset = contentOffset; fob.append(bs); }
private void insertBytesEnclosedAt(int offset, byte[] content, long l) throws ModifyException { if (insertHash.isUnique(offset)==false){ throw new ModifyException("There can be only one insert per offset"); } int contentOffset = (int)l; int contentLen = (int)(l>>32); if (contentOffset < 0 || contentLen <0 || contentOffset+contentLen > content.length){ throw new ModifyException("Invalid contentOffset and/or contentLen"); } flb.append( (long)offset | MASK_INSERT_SEGMENT_BYTE_ENCLOSED); ByteSegment bs = new ByteSegment(); bs.ba = content; bs.len = contentLen; bs.offset = contentOffset; fob.append(bs); }
private void insertBytesEnclosedAt(int offset, byte[] content, long l) throws ModifyException { if (insertHash.isUnique(offset)==false){ throw new ModifyException("There can be only one insert per offset"); } int contentOffset = (int)l; int contentLen = (int)(l>>32); if (contentOffset < 0 || contentLen <0 || contentOffset+contentLen > content.length){ throw new ModifyException("Invalid contentOffset and/or contentLen"); } flb.append( (long)offset | MASK_INSERT_SEGMENT_BYTE_ENCLOSED); ByteSegment bs = new ByteSegment(); bs.ba = content; bs.len = contentLen; bs.offset = contentOffset; fob.append(bs); }
/** * * @param offset * @param content * @param contentOffset * @param contentLen * @throws ModifyException */ private void insertBytesEnclosedAt(int offset, byte[] content, int contentOffset, int contentLen) throws ModifyException { if (insertHash.isUnique(offset)==false){ throw new ModifyException("There can be only one insert per offset"); } if (contentOffset < 0 || contentLen <0 || contentOffset+contentLen > content.length){ throw new ModifyException("Invalid contentOffset and/or contentLen"); } flb.append( (long)offset | MASK_INSERT_SEGMENT_BYTE_ENCLOSED); ByteSegment bs = new ByteSegment(); bs.ba = content; bs.len = contentLen; bs.offset = contentOffset; fob.append(bs); }
/** * Insert a segment of the byte content into XML * @param offset * @param content * @param contentOffset * @param contentLen * @throws ModifyException * */ public void insertBytesAt(int offset, byte[] content, int contentOffset, int contentLen) throws ModifyException { if (insertHash.isUnique(offset)==false){ throw new ModifyException("There can be only one insert per offset"); } if (contentOffset < 0 || contentLen <0 || contentOffset+contentLen > content.length){ throw new ModifyException("Invalid contentOffset and/or contentLen"); } flb.append( (long)offset | MASK_INSERT_SEGMENT_BYTE); ByteSegment bs = new ByteSegment(); bs.ba = content; bs.len = contentLen; bs.offset = contentOffset; fob.append(bs); }