package
1.8.25
Repository: https://github.com/xmplusdev/xray-core.git
Documentation: pkg.go.dev

# Functions

AddToStatCounter a CopyOption add to stat counter.
Compact returns another MultiBuffer by merging all content of the given one together.
Copy dumps all payload from reader to writer or stops when an error occurs.
No description provided by the author
CountSize is a CopyOption that sums the total size of data copied into the given SizeCounter.
FromBytes creates a Buffer with an existed bytearray.
IsReadError returns true if the error in Copy() comes from reading.
IsWriteError returns true if the error in Copy() comes from writing.
MergeBytes merges the given bytes into MultiBuffer and return the new address of the merged MultiBuffer.
MergeMulti merges content from src to dest, and returns the new address of dest and src.
New creates a Buffer with 0 length and 8K capacity.
NewBufferedWriter creates a new BufferedWriter.
NewExisted creates a managed, standard size Buffer with an existed bytearray.
NewPacketReader creates a new PacketReader based on the given reader.
NewReader creates a new Reader.
NewReadVReader creates a new ReadVReader.
NewWriter creates a new Writer.
ReadAllToBytes reads all content from the reader into a byte array, until EOF.
ReadBuffer reads a Buffer from the given reader.
ReadFrom reads all content from reader until EOF.
ReleaseMulti releases all content of the MultiBuffer, and returns an empty MultiBuffer.
SplitBytes splits the given amount of bytes from the beginning of the MultiBuffer.
SplitFirst splits the first Buffer from the beginning of the MultiBuffer.
SplitFirstBytes splits the first buffer from MultiBuffer, and then copy its content into the given slice.
SplitMulti splits the beginning of the MultiBuffer into first one, the index i and after into second one.
SplitSize splits the beginning of the MultiBuffer into another one, for at most size bytes.
StackNew creates a new Buffer object on stack.
UpdateActivity is a CopyOption to update activity on each data copy operation.
WriteAllBytes ensures all bytes are written into the given writer.
WriteMultiBuffer writes all buffers from the MultiBuffer to the Writer one by one, and return error if any, with leftover MultiBuffer.

# Constants

Size of a regular buffer.

# Variables

Discard is a Writer that swallows all contents written in.
DiscardBytes is an io.Writer that swallows all contents written in.
No description provided by the author
ErrReadTimeout is an error that happens with IO timeout.

# Structs

Buffer is a recyclable allocation of a byte array.
BufferedReader is a Reader that keeps its internal buffer.
BufferedWriter is a Writer with internal buffer.
BufferToBytesWriter is a Writer that writes alloc.Buffer into underlying writer.
No description provided by the author
No description provided by the author
MultiBufferContainer is a ReadWriteCloser wrapper over MultiBuffer.
PacketReader is a Reader that read one Buffer every time.
ReadVReader is a Reader that uses readv(2) syscall to read data.
SequentialWriter is a Writer that writes MultiBuffer sequentially into the underlying io.Writer.
SingleReader is a Reader that read one Buffer every time.
SizeCounter is for counting bytes copied by Copy().

# Interfaces

Reader extends io.Reader with MultiBuffer.
TimeoutReader is a reader that returns error if Read() operation takes longer than the given timeout.
Writer extends io.Writer with MultiBuffer.

# Type aliases

CopyOption is an option for copying data.
MultiBuffer is a list of Buffers.