Bug 189813 After modify a wrong preview report, when preview in Web viewer it can not process the document file[1102]
engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/toc/TOCBuilder.java
writeTOC( tree.getTOCRoot( ), out );
	}
	private static void writeTOC( TOCTreeNode root, DataOutputStream out )
			throws IOException
	{
		IOUtil.writeString( out, root.getNodeID( ) );
		IOUtil.writeString( out, root.getDisplayString( ) );
		IOUtil.writeString( out, root.getBookmark( ) );
		IOUtil.writeString( out, root.getHiddenFormats( ) );
		IOUtil.writeBool( out, root.isGroupRoot( ) );
		IOUtil.writeObject( out, root.getTOCValue( ) );
		IOUtil.writeLong( out, root.getElementId( ) );
		List children = root.getChildren( );
		IOUtil.writeInt( out, children.size( ) );
		Iterator iter = children.iterator( );
		while ( iter.hasNext( ) )
		{
			TOCTreeNode child = (TOCTreeNode) iter.next( );
			writeTOC( child, out );
		}
		out.flush( );
		return;
	}
	public static void read( TOCTree tree, DataInputStream input ) throws IOException
	{
		TOCTreeNode node = tree.getTOCRoot( );
		String head = IOUtil.readString( input );
		if ( head == null || ! head.startsWith( VERSION_PREFIX ) )
		{
			readV0( node, input, head, true );