Module basic module

Module io

Input and output processing module

Instructions:

1
var io = require('io');

object

MemoryStream

Create a memory stream object, seeMemoryStream

1
MemoryStream io.MemoryStream;

BufferedStream

Create a cached stream reading object, seeBufferedStream

1
BufferedStream io.BufferedStream;

RangeStream

Create a Range query stream reading object, seeRangeStream

1
RangeStream io.RangeStream;

static function

copyStream

Copy stream data to target stream

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

Call parameters:

  • from:Stream, source object
  • to:Stream, target stream object
  • bytes: Long, number of bytes copied

Return results:

  • Long, returns the number of bytes copied

bridge

Copy stream 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, stream object one
  • stm2:Stream, stream object two