3.61. kink/javahost/JAVA_INPUT

3.61.1. JAVA_INPUT.new(Stream)

`new` makes an `input` val which wraps a Java InputStream object specified by `Stream` arg.

Preconditions:

• `Stream` must be a java val.

• The object reference of `Stream` must be an instance of java.io.InputStream.

Example:

:BIN.require_from('kink/')
:CONTROL.require_from('kink/')
:JAVA.require_from('kink/javahost/')
:JAVA_INPUT.require_from('kink/javahost/')

:Bais_class <- JAVA.class('java.io.ByteArrayInputStream')
:Bais <- Bais_class.new([JAVA.bytes(BIN.of(1 2 3))])
CONTROL.with_on_exit{(:on_exit)
  :In = JAVA_INPUT.new(Bais)
  on_exit{ In.close }
  :Bin = In.read_all
  stdout.print_line(Bin.repr) # => BIN.of(0x01 0x02 0x03)
}

See kink/io/INPUT for `input` type.