当前位置: 首页>>编程示例 >>用法及示例精选 >>正文


GO SectionReader.Size用法及代码示例

GO语言"io"包中"SectionReader.Size"类型的用法及代码示例。

用法:

func(s *SectionReader) Size() int64

Size 返回节的大小(以字节为单位)。

例子:

package main

import (
    "fmt"
    "io"
    "strings"
)

func main() {
    r := strings.NewReader("some io.Reader stream to be read\n")
    s := io.NewSectionReader(r, 5, 17)

    fmt.Println(s.Size())

}

输出:

17

相关用法


注:本文由纯净天空筛选整理自golang.google.cn大神的英文原创作品 SectionReader.Size。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。