Groovy Documentation

org.hidetake.gradle.ssh.internal.interaction
[Groovy] Class LineOutputStream

java.lang.Object
  java.io.OutputStream
      org.hidetake.gradle.ssh.internal.interaction.LineOutputStream

@Slf4j
class LineOutputStream
extends java.io.OutputStream

An implementation of line oriented java.io.OutputStream.

Authors:
hidetake.org


Constructor Summary
LineOutputStream(java.lang.String charset1 = 'UTF-8')

 
Method Summary
void close()

void flush()

Flush the buffer.

void listenLine(groovy.lang.Closure closure)

Add a listener for line processing.

void listenLogging(groovy.lang.Closure closure)

Add a listeners for logging output.

void listenPartial(groovy.lang.Closure closure)

Add a listener for partial matching to the line buffer.

void write(int b)

 
Methods inherited from class java.io.OutputStream
java.io.OutputStream#write([B, int, int), java.io.OutputStream#write([B), java.io.OutputStream#write(int), java.io.OutputStream#flush(), java.io.OutputStream#close(), java.io.OutputStream#wait(long, int), java.io.OutputStream#wait(long), java.io.OutputStream#wait(), java.io.OutputStream#equals(java.lang.Object), java.io.OutputStream#toString(), java.io.OutputStream#hashCode(), java.io.OutputStream#getClass(), java.io.OutputStream#notify(), java.io.OutputStream#notifyAll()
 
Methods inherited from class java.lang.Object
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Constructor Detail

LineOutputStream

LineOutputStream(java.lang.String charset1 = 'UTF-8')


 
Method Detail

close

void close()


flush

void flush()
Flush the buffer. This method may be called regardless of line separators, so it saves last block and write it in the next chance.


listenLine

void listenLine(groovy.lang.Closure closure)
Add a listener for line processing. Called when the stream received a line. The stream must call this when received an new-line character or closed.
Parameters:
closure


listenLogging

void listenLogging(groovy.lang.Closure closure)
Add a listeners for logging output. Called when the stream received a line or at least one of partial listeners returned true.
Parameters:
closure


listenPartial

void listenPartial(groovy.lang.Closure closure)
Add a listener for partial matching to the line buffer. Called when the stream is flushed. This method may be called several times until the stream receives a complete line. If at least one of closures returned true, line buffer will be cleared and logging listeners (see below) will be called. Otherwise, it will be preserved until new-line appears.
Parameters:
closure


write

void write(int b)


 

Groovy Documentation