Class: Croaky::Stream::JavaStdOutStream
- Inherits:
-
StdOutStream
- Object
- StdOutStream
- Croaky::Stream::JavaStdOutStream
- Defined in:
- lib/croaky/stream/java_std_out_stream.rb
Overview
Output stream for Java
Instance Attribute Summary collapse
-
#java_stdout ⇒ Object
Returns the value of attribute java_stdout.
-
#pw_out ⇒ Object
Returns the value of attribute pw_out.
Attributes inherited from StdOutStream
Instance Method Summary collapse
Instance Attribute Details
#java_stdout ⇒ Object
Returns the value of attribute java_stdout.
11 12 13 |
# File 'lib/croaky/stream/java_std_out_stream.rb', line 11 def java_stdout @java_stdout end |
#pw_out ⇒ Object
Returns the value of attribute pw_out.
11 12 13 |
# File 'lib/croaky/stream/java_std_out_stream.rb', line 11 def pw_out @pw_out end |
Instance Method Details
#capture_io ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/croaky/stream/java_std_out_stream.rb', line 13 def capture_io super self.java_stdout = java.lang.System.out pw_out&.close self.pw_out = out_stream java.lang.System.setOut(pw_out) end |
#read_captured_io ⇒ Object
29 30 31 32 33 |
# File 'lib/croaky/stream/java_std_out_stream.rb', line 29 def read_captured_io captured = super captured << read_out_stream end |
#restore_io ⇒ Object
22 23 24 25 26 27 |
# File 'lib/croaky/stream/java_std_out_stream.rb', line 22 def restore_io super java.lang.System.setOut(java_stdout) pw_out.close end |