|
Groovy JDK |
Method Summary | |
---|---|
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. |
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
|
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. |
Method Detail |
---|
public Writer leftShift(Object value)
value
- a value to append.public OutputStream leftShift(InputStream in)
in
- stream to read from.public OutputStream leftShift(byte[] value)
value
- a value to append.public ObjectOutputStream newObjectOutputStream()
public void setBytes(byte[] bytes)
bytes
- the byte[] to write to the output stream.public Object withObjectOutputStream(Closure closure)
closure
- a closure.public Object withStream(Closure closure)
closure
- the closure that the stream is passed into.public Object withWriter(Closure closure)
closure
- the closure that the writer is passed into.public Object withWriter(String charset, Closure closure)
charset
- the charset used.closure
- the closure that the writer is passed into.
|
Groovy JDK |