org.jopendocument.util
Class StreamUtils

java.lang.Object
  extended by org.jopendocument.util.StreamUtils

public class StreamUtils
extends Object


Field Summary
static OutputStream NULL_OS
           
 
Constructor Summary
StreamUtils()
           
 
Method Summary
static void copy(InputStream ins, File out)
           
static void copy(InputStream in, OutputStream out)
          Verbatim copy an entry from input to output stream.
static void copy(InputStream in, OutputStream out, int bufferSize)
           
static long copy(InputStream in, OutputStream out, int bufferSize, long length)
           
static Writer createXMLUnbufferedWriter(OutputStream outs)
           
static BufferedWriter createXMLWriter(OutputStream outs)
          Wrap the output stream into a writer, and write the XML declaration.
static void write(String s, OutputStream out)
           
static void write(String s, OutputStream out, Charset charset)
           
static void writeln(String s, OutputStream out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL_OS

public static final OutputStream NULL_OS
Constructor Detail

StreamUtils

public StreamUtils()
Method Detail

copy

public static void copy(InputStream in,
                        OutputStream out)
                 throws IOException
Verbatim copy an entry from input to output stream.

Parameters:
in - the source.
out - the destination.
Throws:
IOException - if an error occurs while reading or writing.

copy

public static void copy(InputStream in,
                        OutputStream out,
                        int bufferSize)
                 throws IOException
Throws:
IOException

copy

public static long copy(InputStream in,
                        OutputStream out,
                        int bufferSize,
                        long length)
                 throws IOException
Throws:
IOException

copy

public static void copy(InputStream ins,
                        File out)
                 throws IOException
Throws:
IOException

writeln

public static void writeln(String s,
                           OutputStream out)
                    throws IOException
Throws:
IOException

write

public static void write(String s,
                         OutputStream out)
                  throws IOException
Throws:
IOException

write

public static void write(String s,
                         OutputStream out,
                         Charset charset)
                  throws IOException
Throws:
IOException

createXMLWriter

public static BufferedWriter createXMLWriter(OutputStream outs)
                                      throws IOException
Wrap the output stream into a writer, and write the XML declaration.

Parameters:
outs - an output stream.
Returns:
a writer with the same encoding as the XML.
Throws:
IOException - if an error occurs.

createXMLUnbufferedWriter

public static Writer createXMLUnbufferedWriter(OutputStream outs)
                                        throws IOException
Throws:
IOException


Copyright © 2010 jOpenDocument All Rights Reserved.