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.
Types ¶
type SplitWriter ¶
type SplitWriter struct {
// contains filtered or unexported fields
}
func NewWriter ¶
func NewWriter(writer io.Writer, prefixBytes int64) *SplitWriter
NewWriter creates a io.Writer that ensures the byte sequence is split at prefixBytes, meaning 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].
Click to show internal directories.
Click to hide internal directories.