Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
Socket
Book a DemoInstallSign in
Socket

vimagination.zapto.org/memio

Package Overview
Dependencies
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vimagination.zapto.org/memio

Go Modules
Version
v1.1.1
Version published
Created
Source

memio

CI Go Reference Go Report Card

-- import "vimagination.zapto.org/memio"

Package memio implements Read, Write, Seek, Close and other io methods for a byte slice.

Highlights

  • memio.Buffer: a slice that implements many IO interfaces. It advances the length of the slice as bytes are read, and moves the start of the slice as bytes are read. Some of the interfaces implemented are:
    • io.Reader
    • io.ReaderFrom
    • io.ByteReader
    • io.RuneReader
    • io.Writer
    • io.WriterTo
    • io.ByteWriter
    • io.RuneWriter
    • io.Closer
    • io.ReaderAt
    • io.WriterAt
    • & more.
  • memio.LimitedBuffer: similar to memio.Buffer, but will not grow beyond it's capacity.
  • memio.ReadMem: a wrapper around bytes.Reader that also implements io.Closer and a Peek method.
  • memio.WriteMem: a more compatible version of memio.Buffer that doesn't forget read bytes.

Usage

package main

import (
	"errors"
	"fmt"
	"io"

	"vimagination.zapto.org/memio"
)

func main() {
	var buf memio.Buffer

	buf.WriteString("Hello, world!")

	data := make([]byte, 5)

	buf.Read(data)

	fmt.Printf("%s", data)
	// Output: Hello
}

Documentation

Full API docs can be found at:

https://pkg.go.dev/vimagination.zapto.org/memio

FAQs

Package last updated on 20 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts