import java.io.*; import java.util.*; import com.ximpleware.*; public class TransformVTD { public static byte[] getBytesFromFile(File file) throws IOException { InputStream is = new FileInputStream(file); long length = file.length(); byte[] bytes = new byte[(int)length]; int offset = 0; int numRead = 0; while (offset < bytes.length && (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0) { offset += numRead; } if (offset < bytes.length) { throw new IOException("Could not completely read file "+file.getName()); } is.close(); return bytes; } public static void main(String args[]) { test(true); test(true); test(true); test(true); test(true); test(true); test(true); test(true); test(true); test(true); } public static void test(boolean forReal) { XMLModifier xm = new XMLModifier(); VTDGen vg = new VTDGen(); VTDNav vn = null; AutoPilot ap = new AutoPilot(); long start; long end; int kk=10; double time = 0.0; int i=0; int j = 0; double res = 0; try { byte[] content = getBytesFromFile(new File("blog.xml")); ByteArrayOutputStream baos = new ByteArrayOutputStream(content.length * 2); start = System.currentTimeMillis(); for (int ii=0; ii