I cannot reproduce this problem, here is my test case. import org.apache.ecs.html.TT; import org.apache.ecs.html.BR; import org.apache.ecs.Document; import org.apache.ecs.Doctype; import org.apache.ecs.Entities; import java.io.ByteArrayInputStream;
public class test { public static void main(String[] args) { Document doc = new Document(); doc.setDoctype(new Doctype.Html40Transitional()); TT tt = new TT(); long mem = Runtime.getRuntime().freeMemory(); long total = Runtime.getRuntime().totalMemory(); String f = "Total amount of memory in VM : "+total+"\n"+"Amount of memory still available : "+mem+"\n"+"Amount of memory used = "+(total-mem)+"\n"+"Construct time : "+System.currentTimeMillis()+"\n"; ByteArrayInputStream bais = new ByteArrayInputStream(f.getBytes()); byte[] buffer = new byte[1024]; try { while(true) { int read = bais.read(buffer); if(read == -1) break; for(int x = 0 ; x < read; x++) { if(f.charAt(x) =='\n') tt.addElement(new BR()); else if(f.charAt(x) == ' ') tt.addElement(Entities.NBSP); //tt.addElement(" "); else // tt.addElement(String.valueOf(f.charAt(x))); tt.addElement(new String(buffer,x,1)); } } doc.appendBody(tt); doc.output(System.out); } catch(java.io.IOException ioe) { ioe.printStackTrace(); } } } -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>