Module basic module

Module io

Input and output processing module

Instructions:

1
var io = require('io');

Object

MemoryStream

Create a memory stream object, see MemoryStream

1
MemoryStream io.MemoryStream;

BufferedStream

Create a cache stream to read the object, see BufferedStream

1
BufferedStream io.BufferedStream;

RangeStream

Create a Range query stream read object, see RangeStream

1
RangeStream io.RangeStream;

Static function

copyStream

Copy the stream data to the target stream

1 2 3
static Long io.copyStream(Stream from, Stream to, Long bytes = -1) async;

Call parameters:

  • from: Stream, Source stream object
  • to: Stream, The target stream object
  • bytes: Long, the number of bytes copied

Return result:

  • Long, Returns the number of bytes copied

bridge

Copy streaming data in both directions until there is no data in the stream or the stream is closed

1 2
static io.bridge(Stream stm1, Stream stm2) async;

Call parameters:

  • stm1: Stream, Flow object one
  • stm2: Stream, Flow object two