目录

接口

interface IOStream

public interface IOStream <: InputStream & OutputStream {}

功能:输入输出流接口。

interface InputStream

public interface InputStream {
    func read(buffer: Array<Byte>): Int64
}

功能:输入流接口。

[h2]func read(Array<Byte>)

func read(buffer: Array<Byte>): Int64

功能:从输入流中读取数据放到 buffer 中。

参数:

返回值:

interface OutputStream

public interface OutputStream {
    func write(buffer: Array<Byte>): Unit
    func flush(): Unit
}

功能:输出流接口。

[h2]func flush()

func flush(): Unit

功能:清空缓存区。该函数提供默认实现,默认实现为空。

[h2]func write(Array<Byte>)

func write(buffer: Array<Byte>): Unit

功能:将 buffer 中的数据写入到输出流中。

参数:

interface Seekable

public interface Seekable {
    prop length: Int64
    prop position: Int64
    prop remainLength: Int64
    func seek(sp: SeekPosition): Int64
}

功能:移动光标接口。

[h2]prop length

public prop length: Int64

功能:返回当前流中的总数据量。

类型:Int64

[h2]prop position

public prop position: Int64

功能:返回当前光标位置。

类型:Int64

[h2]prop remainLength

public prop remainLength: Int64

功能:返回当前流中未读的数据量。

类型:Int64

[h2]func seek(SeekPosition)

public func seek(sp: SeekPosition): Int64

功能:移动光标到指定的位置。

参数:

返回值: