iohelper

package
v0.5.9 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2019 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

This section is empty.

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.

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.

func (*SectionWriter) Seek

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

Seek seeks to relative position by offset.

func (*SectionWriter) Size

func (s *SectionWriter) Size() int64

Size returns the size of the section in bytes.

func (*SectionWriter) Write

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

func (*SectionWriter) WriteAt

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

WriteAt write buf p at relative position off.

Jump to

Keyboard shortcuts

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