Just create the writer before calling getTreeInfo and pass the writer to the method:
Code:
private void getTreeInfo( AvlNode t, Writer out) throws IOException
Then adjust your recursive calls to getTreeInfo(t.left, out), and symmetrically for the right side.