com.partnersoft.io
Interface OutputSink


public interface OutputSink

A generic output sink. Provides output streams and writers upon request.

Copyright 2006 Partner Software, Inc.

Version:
$Id: OutputSink.java 1012 2007-11-24 18:30:02Z paul $
Author:
Paul Reavis

Method Summary
 java.io.BufferedOutputStream createAppendingBufferedOutputStream()
          Creates a buffered output stream to write to the file.
 java.io.BufferedWriter createAppendingBufferedWriter()
          Creates a buffered writer to write to the file.
 java.io.OutputStream createAppendingOutputStream()
          Creates an output stream to append to the file.
 java.io.Writer createAppendingWriter()
          Creates a writer to append text to the file.
 java.io.BufferedOutputStream createBufferedOutputStream()
          Creates a buffered output stream to write to the file.
 java.io.BufferedWriter createBufferedWriter()
          Creates a buffered writer to write to the file.
 java.io.OutputStream createOutputStream()
          Creates an output stream to write to the file.
 java.io.Writer createWriter()
          Creates a writer to write to the file.
 java.net.URI getAbsoluteURI()
          Absolute URI for this source.
 java.lang.String getName()
          Simple name for this source.
 java.net.URI getURI()
          Relative URI for this source.
 

Method Detail

getName

java.lang.String getName()
Simple name for this source.


getURI

java.net.URI getURI()
Relative URI for this source.


getAbsoluteURI

java.net.URI getAbsoluteURI()
Absolute URI for this source.


createOutputStream

java.io.OutputStream createOutputStream()
                                        throws java.io.IOException
Creates an output stream to write to the file. The stream will overwrite any existing contents of the file - in fact, just calling this method will erase any existing contents, so be careful. You must close the stream when you are done with it (OutputStream.close()). Note that this stream is NOT buffered. This is usually a bad thing, unless you are doing your own buffering or doing a bulk write. So, don't use this method unless you know what you're doing - use createBufferedOutputStream() instead.

Returns:
stream you can write to
Throws:
java.io.IOException

createBufferedOutputStream

java.io.BufferedOutputStream createBufferedOutputStream()
                                                        throws java.io.IOException
Creates a buffered output stream to write to the file. The stream will overwrite any existing contents of the file - in fact, just calling this method will erase any existing contents, so be careful. You must close the stream when you are done with it (OutputStream.close()). This stream is buffered, which is usually a good thing. You should generally use this instead of createOutputStream() unless you know what you're doing.

Returns:
stream you can write to
Throws:
java.io.IOException

createAppendingOutputStream

java.io.OutputStream createAppendingOutputStream()
                                                 throws java.io.IOException
Creates an output stream to append to the file. The stream will NOT overwrite the existing contents of the file; instead it adds to the end. You must close the stream when you are done with it (OutputStream.close()). Note that this stream is NOT buffered. This is usually a bad thing, unless you are doing your own buffering or doing a bulk write. So, don't use this method unless you know what you're doing - use createAppendingBufferedOutputStream() instead.

Returns:
stream you can write to
Throws:
java.io.IOException

createAppendingBufferedOutputStream

java.io.BufferedOutputStream createAppendingBufferedOutputStream()
                                                                 throws java.io.IOException
Creates a buffered output stream to write to the file. The stream will NOT overwrite the existing contents of the file; instead it adds to the end. You must close the stream when you are done with it (OutputStream.close()). This stream is buffered, which is usually a good thing. You should generally use this instead of createAppendingOutputStream() unless you know what you're doing.

Returns:
stream you can write to
Throws:
java.io.IOException

createWriter

java.io.Writer createWriter()
                            throws java.io.IOException
Creates a writer to write to the file. The writer will overwrite any existing contents of the file - in fact, just calling this method will erase any existing contents, so be careful. You must close the writer when you are done with it (Writer.close()). Note that this writer is NOT buffered. This is usually a bad thing, unless you are doing your own buffering or doing a bulk write. So, don't use this method unless you know what you're doing - use createBufferedWriter() instead.

Returns:
writer you can write to
Throws:
java.io.IOException

createBufferedWriter

java.io.BufferedWriter createBufferedWriter()
                                            throws java.io.IOException
Creates a buffered writer to write to the file. The writer will overwrite any existing contents of the file - in fact, just calling this method will erase any existing contents, so be careful. You must close the writer when you are done with it (Writer.close()). This writer is buffered, which is usually a good thing. You should generally use this instead of createWriter() unless you know what you're doing.

Returns:
writer you can write to
Throws:
java.io.IOException

createAppendingWriter

java.io.Writer createAppendingWriter()
                                     throws java.io.IOException
Creates a writer to append text to the file. The writer will NOT overwrite the existing contents of the file; instead it adds to the end. You must close the writer when you are done with it (Writer.close()). Note that this writer is NOT buffered. This is usually a bad thing, unless you are doing your own buffering or doing a bulk write. So, don't use this method unless you know what you're doing - use createAppendingBufferedWriter() instead.

Returns:
writer you can write to
Throws:
java.io.IOException

createAppendingBufferedWriter

java.io.BufferedWriter createAppendingBufferedWriter()
                                                     throws java.io.IOException
Creates a buffered writer to write to the file. The writer will NOT overwrite the existing contents of the file; instead it adds to the end. You must close the writer when you are done with it (OutputStream.close()). This writer is buffered, which is usually a good thing. You should generally use this instead of createAppendingWriter() unless you know what you're doing.

Returns:
writer you can write to
Throws:
java.io.IOException