split

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStreamDialer

func NewStreamDialer(dialer transport.StreamDialer, prefixBytes int64) (transport.StreamDialer, error)

NewStreamDialer creates a transport.StreamDialer that splits the outgoing stream after writing "prefixBytes" bytes using [SplitWriter].

func NewWriter

func NewWriter(writer io.Writer, prefixBytes int64) io.Writer

NewWriter creates a io.Writer that ensures the byte sequence is split at prefixBytes. A write will end right after byte index prefixBytes - 1, before a write starting at byte index prefixBytes. For example, if you have a write of [0123456789] and prefixBytes = 3, you will get writes [012] and [3456789]. If the input writer is a io.ReaderFrom, the output writer will be too.

Types

This section is empty.

Jump to

Keyboard shortcuts

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