org.openjena.atlas.io
Class IO

java.lang.Object
  extended by org.openjena.atlas.io.IO

public class IO
extends java.lang.Object


Field Summary
static java.lang.String encodingAscii
           
static java.lang.String encodingUTF8
          Java name for UTF-8 encoding
static int EOF
           
static int UNSET
           
 
Constructor Summary
IO()
           
 
Method Summary
static java.io.Reader asASCII(java.io.InputStream in)
          Create a reader that uses ASCII encoding
static java.io.BufferedReader asBufferedUTF8(java.io.InputStream in)
          Create an buffered reader that uses UTF-8 encoding
static java.io.PrintWriter asPrintWriterUTF8(java.io.OutputStream out)
          Create a print writer that uses UTF-8 encoding
static java.io.Reader asUTF8(java.io.InputStream in)
          Create an unbuffered reader that uses UTF-8 encoding
static java.io.Writer asUTF8(java.io.OutputStream out)
          Create a writer that uses UTF-8 encoding
static void close(java.io.InputStream in)
           
static void close(java.io.OutputStream out)
           
static void close(java.io.Reader in)
           
static void close(java.io.Writer out)
           
static void exception(java.io.IOException ex)
           
static void flush(java.io.OutputStream out)
           
static void flush(java.io.Writer out)
           
static java.io.InputStream openFile(java.lang.String filename)
          Open an input stream to a file.
static java.io.Reader openFileASCII(java.lang.String filename)
          Open an ASCII Reader for a file.
static java.io.InputStream openFileEx(java.lang.String filename)
          Open an input stream to a file; do not mask IOExceptions.
static java.io.Reader openFileUTF8(java.lang.String filename)
          Open a UTF8 Reader for a file.
static byte[] readWholeFile(java.io.InputStream in)
           
static java.lang.String readWholeFileAsUTF8(java.io.InputStream in)
          Read a whole stream as UTF-8
static java.lang.String readWholeFileAsUTF8(java.lang.String filename)
          Read a whole file as UTF-8
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EOF

public static final int EOF
See Also:
Constant Field Values

UNSET

public static final int UNSET
See Also:
Constant Field Values

encodingUTF8

public static final java.lang.String encodingUTF8
Java name for UTF-8 encoding

See Also:
Constant Field Values

encodingAscii

public static final java.lang.String encodingAscii
See Also:
Constant Field Values
Constructor Detail

IO

public IO()
Method Detail

openFile

public static java.io.InputStream openFile(java.lang.String filename)
Open an input stream to a file. If the filename is null or "-", return System.in If the filename ends in .gz, wrap in GZIPInputStream


openFileEx

public static java.io.InputStream openFileEx(java.lang.String filename)
                                      throws java.io.IOException
Open an input stream to a file; do not mask IOExceptions. If the filename is null or "-", return System.in If the filename ends in .gz, wrap in GZIPInputStream

Parameters:
filename -
Throws:
java.io.FileNotFoundException
java.io.IOException

openFileUTF8

public static java.io.Reader openFileUTF8(java.lang.String filename)
Open a UTF8 Reader for a file. If the filename is null or "-", use System.in If the filename ends in .gz, use GZIPInputStream


openFileASCII

public static java.io.Reader openFileASCII(java.lang.String filename)
Open an ASCII Reader for a file. If the filename is null or "-", use System.in If the filename ends in .gz, use GZIPInputStream


asUTF8

public static java.io.Reader asUTF8(java.io.InputStream in)
Create an unbuffered reader that uses UTF-8 encoding


asASCII

public static java.io.Reader asASCII(java.io.InputStream in)
Create a reader that uses ASCII encoding


asBufferedUTF8

public static java.io.BufferedReader asBufferedUTF8(java.io.InputStream in)
Create an buffered reader that uses UTF-8 encoding


asUTF8

public static java.io.Writer asUTF8(java.io.OutputStream out)
Create a writer that uses UTF-8 encoding


asPrintWriterUTF8

public static java.io.PrintWriter asPrintWriterUTF8(java.io.OutputStream out)
Create a print writer that uses UTF-8 encoding


close

public static void close(java.io.InputStream in)

close

public static void close(java.io.OutputStream out)

close

public static void close(java.io.Reader in)

close

public static void close(java.io.Writer out)

exception

public static void exception(java.io.IOException ex)

flush

public static void flush(java.io.OutputStream out)

flush

public static void flush(java.io.Writer out)

readWholeFile

public static byte[] readWholeFile(java.io.InputStream in)

readWholeFileAsUTF8

public static java.lang.String readWholeFileAsUTF8(java.lang.String filename)
                                            throws java.io.IOException
Read a whole file as UTF-8

Parameters:
filename -
Returns:
String
Throws:
java.io.IOException

readWholeFileAsUTF8

public static java.lang.String readWholeFileAsUTF8(java.io.InputStream in)
                                            throws java.io.IOException
Read a whole stream as UTF-8

Parameters:
in - InputStream to be read
Returns:
String
Throws:
java.io.IOException


Copyright ? 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP Copyright ? 2010 Talis Systems Ltd. Copyright ? 2010, 2011 Epimorphics Ltd.