public void readSource ( String input ) throws GraphVizException { StringBuilder sb = new StringBuilder ( ) ; try { FileInputStream fis = new FileInputStream ( input ) ; DataInputStream dis = new DataInputStream ( fis ) ; BufferedReader br = new BufferedReader ( new InputStreamReader ( dis ) ) ; String line ; while ( ( line = br . readLine ( ) ) != null ) { sb . append ( line ) ; } dis . close ( ) ; } catch ( Exception e ) { throw new GraphVizException ( "Error: " + e . getMessage ( ) ) ; } this . graph = sb ; }
Read a DOT graph from a text file .