Module JavaIOStreams

module JavaIOStreams: sig .. end
Utility functions for Java streams, and conversions between Java streams and OCaml channels.


Instance creation

 
val open_in : ?buffered:bool -> JavaString.t -> java'io'InputStream java_instance
open_in ?buffered str returns a new java.io.InputStream instance reading data from the file whose path is str. The buffered parameter (defaulting to true) indicates whether the stream is buffered.
Raises Java_exception if an error occurs
 
val open_out : ?buffered:bool -> JavaString.t -> java'io'OutputStream java_instance
open_out ?buffered str returns a new java.io.OutputStream instance writing data to the file whose path is str. The buffered parameter (defaulting to true) indicates whether the stream is buffered.
Raises Java_exception if an error occurs
 

Closing

 
val close_in : java'io'InputStream java_extends -> unit
Closes the passed stream.
Raises Java_exception if an error occurs
 
val close_in_noerr : java'io'InputStream java_extends -> unit
Closes the passed stream, discarding any error.
 
val close_out : java'io'InputStream java_extends -> unit
Closes the passed stream.
Raises Java_exception if an error occurs
 
val close_out_noerr : java'io'InputStream java_extends -> unit
Closes the passed stream, discarding any error.
 

Conversions

 
val in_channel_of_input_stream : java'io'InputStream java_extends -> Pervasives.in_channel
in_channel_of_input_stream is converts the input stream is into a new input channel. The returned channel is added to the list of opened channels.
 
val out_channel_of_output_stream : java'io'OutputStream java_extends -> Pervasives.out_channel
out_channel_of_output_stream os converts the output stream os into a new output channel. The returned channel is added to the list of opened channels.
 
val input_stream_of_in_channel : Pervasives.in_channel -> java'io'InputStream java_instance
input_stream_of_in_channel ic converts the input channel ic into a new input stream.
 
val output_stream_of_out_channel : Pervasives.out_channel -> java'io'OutputStream java_instance
output_stream_of_out_channel oc converts the output channel oc into a new output stream.