iohelper

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package iohelper provides extra interfaces than package io.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AtToReader

func AtToReader(r io.ReaderAt, offset int64) io.Reader

AtToReader convert a ReaderAt to a Reader

Since 0.1.6

func AtToWriter

func AtToWriter(w io.WriterAt, offset int64) io.Writer

AtToWriter convert a WriterAt to a Writer

Since 0.1.6

Types

type SectionWriter

type SectionWriter struct {
	// contains filtered or unexported fields
}

SectionWriter implements Write, Seek, and WriteAt on a section of an underlying io.WriterAt.

Since 0.1.6

func NewSectionWriter

func NewSectionWriter(w io.WriterAt, off int64, n int64) *SectionWriter

NewSectionWriter returns a SectionWriter that writes to w starting at offset off and stops with io.ErrShortWrite after n bytes.

Since 0.1.6

func (*SectionWriter) Seek

func (s *SectionWriter) Seek(offset int64, whence int) (int64, error)

Seek seeks to relative position by offset.

Since 0.1.6

func (*SectionWriter) Size

func (s *SectionWriter) Size() int64

Size returns the size of the section in bytes.

Since 0.1.6

func (*SectionWriter) Write

func (s *SectionWriter) Write(p []byte) (n int, err error)

Write buf "p".

Since 0.1.6

func (*SectionWriter) WriteAt

func (s *SectionWriter) WriteAt(p []byte, off int64) (n int, err error)

WriteAt write buf p at relative position off.

Since 0.1.6

Jump to

Keyboard shortcuts

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