utils

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChunkPayload

func ChunkPayload(c *chunk.Chunk, e chunk.Encoding) (subChunks [][]byte, r define.Range)

ChunkPayload ..

func FromChunkPayload

func FromChunkPayload(subChunks [][]byte, r define.Range, e chunk.Encoding) (c *chunk.Chunk, err error)

FromChunkPayload ..

func Gzip

func Gzip(in []byte) (result []byte, err error)

Gzip ..

func MarshalNBT

func MarshalNBT(writer *bytes.Buffer, value any, name string)

MarshalNBT marshal value as its little endian NBT represents to writer. Note that this implements is stable because the key in TAG_Compound is sorted. Other features are same to NBT implement on gophertunnel.

func Uint32BinaryAdd

func Uint32BinaryAdd(uint32Bytes []byte, defaultIfNotExist []byte, delta int32) []byte

Uint32BinaryAdd decode a little endian uint32Bytes as uint32, and computes the result of uint32+delta, and then return its little endian bytes result. If len(uint32Bytes) < 4, then use defaultIfNotExist instead.

func Ungzip

func Ungzip(in []byte) (result []byte, err error)

Ungzip ..

Types

This section is empty.

Jump to

Keyboard shortcuts

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