package com.codeski.nbt;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;

public class Main
{
	public static void main(String[] args) throws FileNotFoundException, IOException
	{
		File f = new File(args[0]);
		System.out.println("Start reading " + f.getAbsolutePath() + "...");
		System.out.println(new NBTReader(f).read());
		System.out.println("Finished reading " + f.getAbsolutePath() + "...");
	}
}

@@ -107,16 +107,58 @@
 ption;%0A%0A
+import com.codeski.nbt.tags.NBTCompound;%0A%0A
 public c
@@ -356,35 +356,49 @@
 ..%22);%0A%09%09
-System.out.println(
+NBTCompound root = (NBTCompound) 
 new NBTR
@@ -412,17 +412,16 @@
 ).read()
-)
 ;%0A%09%09Syst
@@ -487,13 +487,250 @@
 %22...%22);%0A
+%09%09System.out.println();%0A%09%09System.out.println(%22%7B %22 + root.toJSON() + %22 %7D%22);%0A%09%09System.out.println();%0A%09%09System.out.println(%22%3C?xml version=%5C%221.0%5C%22 encoding=%5C%22UTF-8%5C%22?%3E%22 + root.toXML());%0A%09%09System.out.println();%0A%09%09System.out.println(%22Done!%22);%0A
 %09%7D%0A%7D%0A

Clean up main class and show JSON and XML output