ioop

package
v0.5.22 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2024 License: MIT Imports: 13 Imported by: 0

README

サンプルリスト

このディレクトリには以下のサンプルがあります。

file example name note
limitread.go ioop_limit_read io.LimitedReader のサンプルです.
onebyteread.go ioop_onebyte_read 1バイトずつ読み出す io.LimitedReader のサンプルです.
multiwrite.go ioop_multiwrite io.MultiWriterを利用してgzip圧縮しながらCRCチェックサムも算出するサンプルです.
multiread.go ioop_multiread io.MultiReaderを利用して複数のファイルを一気に読み込むサンプルです。
teeread.go ioop_tee_read io.TeeReader を利用したサンプルです。
sectionread.go ioop_section_read io.SectionReader を利用したサンプルです。
offsetwrite.go ioop_offset_write io.OffsetWriter を利用したサンプルです。

Documentation

Overview

Package ioop -- ioパッケージなどに存在する デコレータ 系の処理についてサンプルが配置されています.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LimitRead

func LimitRead() error

LimitRead は、io.LimitedReader のサンプルです.

通信データのように固定部分を決まったサイズで読み取るときなどに便利。

REFERENCES

func MultiRead added in v0.5.19

func MultiRead() error

MultiRead は、io.MultiReaderを利用して複数のファイルを一気に読み込むサンプルです。

> MultiReader returns a Reader that's the logical concatenation of the provided input readers. They're read sequentially. Once all inputs have returned EOF, Read will return EOF. If any of the readers return a non-nil, non-EOF error, Read will return that error.

> MultiReaderは、与えられた入力リーダーを論理的に連結したリーダーを返します。 順次読み込まれ、すべての入力がEOFを返したらEOFを返します。 いずれかのリーダがEOF以外のエラーを返した場合、Readはそのエラーを返します。

REFERENCES

func MultiWrite added in v0.5.19

func MultiWrite() error

MultiWrite は、io.MultiWriterを利用してgzip圧縮しながらCRCチェックサムも算出するサンプルです.

REFERENCES

func NewRegister

func NewRegister() mapping.Register

NewRegister -- このパッケージ用のサンプルを登録する mapping.Register を生成します。

func OffsetWrite added in v0.5.20

func OffsetWrite() error

OffsetWrite は、io.OffsetWriter を利用したサンプルです。

io.OffsetWriter は、io.WriterAt インターフェースを実装しているものを要求する。

os.File が io.WriterAt を実装している。

REFERENCES

func OneByteRead

func OneByteRead() error

OneByteRead は、1バイトずつ読み出す io.LimitedReader のサンプルです.

通信データのように固定部分を決まったサイズで読み取るときなどに便利。

REFERENCES

func SectionRead added in v0.5.20

func SectionRead() error

SectionRead は、io.SectionReader を利用したサンプルです。

io.SectionReader は、指定した範囲のデータを読み込んでくれる特殊ストリーム。

> SectionReader implements Read, Seek, and ReadAt on a section of an underlying ReaderAt.

> SectionReaderは、Read、Seek、ReadAtを実装しています。

REFERENCES

func TeeRead added in v0.5.20

func TeeRead() error

TeeRead は、io.TeeReader を利用したサンプルです。

io.TeeReader は、teeコマンドと同じような動きをする。読み取ったデータは戻り値のReaderを経由して取得し、さらに引数で指定したio.Writerにも書き込まれる。

> TeeReader returns a Reader that writes to w what it reads from r. All reads from r performed through it are matched with corresponding writes to w.

> TeeReaderは、rから読み取ったものをwに書き込むReaderを返します。TeeReaderを介して実行されるrからのすべての読み取りは、対応するwへの書き込みと一致します。

io.TeeReaderには、内部バッファを持っていない。 なので、rから読み取ったデータは即時wに書き込まないとブロックされてしまう。

REFERENCES

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL