streamutil

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

* Copyright (C) 2024 Puter Technologies Inc. * * This file is part of puter-fuse. * * puter-fuse is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>.

* Copyright (C) 2024 Puter Technologies Inc. * * This file is part of puter-fuse. * * puter-fuse is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>.

* Copyright (C) 2024 Puter Technologies Inc. * * This file is part of puter-fuse. * * puter-fuse is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>.

* Copyright (C) 2024 Puter Technologies Inc. * * This file is part of puter-fuse. * * puter-fuse is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReplaceReader

func NewReplaceReader(original io.ReadCloser, source []byte, offset uint64) io.ReadCloser

Types

type NullCloser

type NullCloser struct{}

func (*NullCloser) Close

func (n *NullCloser) Close() error

type ReaderReadCloser

type ReaderReadCloser struct {
	Delegate io.Reader
	Closer   io.Closer
}

ReaderReadCloser is a wrapper around an io.Reader that also implements the io.ReadCloser interface.

func NewReaderReadCloser

func NewReaderReadCloser(delegate io.Reader, closer io.Closer) *ReaderReadCloser

func (*ReaderReadCloser) Close

func (r *ReaderReadCloser) Close() error

Close implements the io.Closer interface for ReaderReadCloser.

func (*ReaderReadCloser) Read

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

Read implements the io.Reader interface for ReaderReadCloser.

type ReplaceReader

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

func (*ReplaceReader) Close

func (replaceReader *ReplaceReader) Close() error

Close implements the io.Closer interface, ensuring the original reader is closed.

func (*ReplaceReader) Read

func (replaceReader *ReplaceReader) Read(p []byte) (int, error)

Read implements the io.Reader interface for customReader.

type SmallBufferReader

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

SmallBufferReader is an io.Reader that reads from an underlying reader in smaller, fixed-size chunks. (written by

func NewSmallBufferReader

func NewSmallBufferReader(r io.Reader, bufSize int) *SmallBufferReader

NewSmallBufferReader creates a new SmallBufferReader with the given buffer size.

func (*SmallBufferReader) Read

func (sbr *SmallBufferReader) Read(p []byte) (n int, err error)

Read reads up to len(p) bytes into p from the underlying reader, but limited to bufSize bytes per read operation.

Jump to

Keyboard shortcuts

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