public Document toXml ( InputStream json ) throws IOException , NotImplemented { JsonReader reader = null ; try { reader = new JsonReader ( new InputStreamReader ( json , "utf-8" ) ) ; return parse ( reader ) ; } catch ( UnsupportedEncodingException e ) { throw new IllegalStateException ( e ) ; } finally { if ( reader != null ) reader . close ( ) ; if ( json != null ) json . close ( ) ; } }
First element must be a document