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 buffered stream to read the object, see BufferedStream

1
BufferedStream io.BufferedStream;

Static function

copyStream

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