Return type | Name and parameters |
---|---|
Writer
|
leftShift(Object value)
Overloads the leftShift operator to provide an append mechanism to add values to a stream. |
OutputStream
|
leftShift(InputStream in)
Pipe an InputStream into an OutputStream for efficient stream copying. |
OutputStream
|
leftShift(byte[] value)
Overloads the leftShift operator to provide an append mechanism to add bytes to a stream. |
ObjectOutputStream
|
newObjectOutputStream()
Create an object output stream for this output stream. |
PrintWriter
|
newPrintWriter()
Create a new PrintWriter for this OutputStream. |
Writer
|
newWriter()
Creates a writer for this stream. |
Writer
|
newWriter(String charset)
Creates a writer for this stream using the given charset. |
void
|
setBytes(byte[] bytes)
Write the byte[] to the output stream. |
Object
|
withObjectOutputStream(Closure closure)
Create a new ObjectOutputStream for this output stream and then pass it to the closure. |
Object
|
withPrintWriter(Closure closure)
Create a new PrintWriter for this OutputStream. |
Object
|
withStream(Closure closure)
Passes this OutputStream to the closure, ensuring that the stream is closed after the closure returns, regardless of errors. |
Object
|
withWriter(Closure closure)
Creates a writer from this stream, passing it to the given closure. |
Object
|
withWriter(String charset, Closure closure)
Creates a writer from this stream, passing it to the given closure. |
Overloads the leftShift operator to provide an append mechanism to add values to a stream.
value
- a value to append.Pipe an InputStream into an OutputStream for efficient stream copying.
in
- stream to read from.Overloads the leftShift operator to provide an append mechanism to add bytes to a stream.
value
- a value to append.Create an object output stream for this output stream.
Create a new PrintWriter for this OutputStream.
Creates a writer for this stream.
Creates a writer for this stream using the given charset.
charset
- the charset used.Write the byte[] to the output stream. The stream is closed before this method returns.
bytes
- the byte[] to write to the output stream.Create a new ObjectOutputStream for this output stream and then pass it to the closure. This method ensures the stream is closed after the closure returns.
closure
- a closure.Create a new PrintWriter for this OutputStream. The writer is passed to the closure, and will be closed before this method returns.
closure
- the closure to invoke with the PrintWriter.Passes this OutputStream to the closure, ensuring that the stream is closed after the closure returns, regardless of errors.
closure
- the closure that the stream is passed into.Creates a writer from this stream, passing it to the given closure. This method ensures the stream is closed after the closure returns.
closure
- the closure that the writer is passed into.Creates a writer from this stream, passing it to the given closure. This method ensures the stream is closed after the closure returns.
charset
- the charset used.closure
- the closure that the writer is passed into.