readerat

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package readerat provides utilities for the io.ReaderAt type.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReadSeeker

type ReadSeeker struct {
	ReaderAt io.ReaderAt
	Size     int64
	// contains filtered or unexported fields
}

ReadSeeker is an io.ReadSeeker implementation based on an io.ReaderAt (and an int64 size).

For example, an os.File is both an io.ReaderAt and an io.ReadSeeker, but its io.ReadSeeker methods are not safe to use concurrently. In comparison, multiple readerat.ReadSeeker values (using the same os.File as their io.ReaderAt) are safe to use concurrently. Each can Read and Seek independently.

A single readerat.ReadSeeker is not safe to use concurrently.

Do not modify its exported fields after calling any of its methods.

func (*ReadSeeker) Read

func (r *ReadSeeker) Read(p []byte) (int, error)

Read implements io.Reader.

func (*ReadSeeker) Seek

func (r *ReadSeeker) Seek(offset int64, whence int) (int64, error)

Seek implements io.Seeker.

Jump to

Keyboard shortcuts

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