swapreader

package
v0.0.0-...-5204ab8 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: MIT, MIT Imports: 1 Imported by: 1

README

swapreader

-- import "github.com/cmcoffee/snugforge/swapreader"

Usage

type Reader
type Reader struct {
}

Reader provides a way to read data from either a byte slice or an io.Reader.

func (*Reader) Read
func (r *Reader) Read(p []byte) (n int, err error)

Read reads bytes from the internal buffer or reader. It returns the number of bytes read and a possible error.

func (*Reader) SetBytes
func (r *Reader) SetBytes(in []byte)

SetBytes sets the underlying byte slice for reading. It disables reading from an io.Reader.

func (*Reader) SetReader
func (r *Reader) SetReader(in io.Reader)

SetReader sets the underlying reader for decoding. It indicates that the Reader will receive input from an io.Reader.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

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

Reader provides a way to read data from either a byte slice or an io.Reader.

func (*Reader) Read

func (r *Reader) Read(p []byte) (n int, err error)

Read reads bytes from the internal buffer or reader. It returns the number of bytes read and a possible error.

func (*Reader) SetBytes

func (r *Reader) SetBytes(in []byte)

SetBytes sets the underlying byte slice for reading. It disables reading from an io.Reader.

func (*Reader) SetReader

func (r *Reader) SetReader(in io.Reader)

SetReader sets the underlying reader for decoding. It indicates that the Reader will receive input from an io.Reader.

Jump to

Keyboard shortcuts

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