package sdkio

import "github.com/aws/aws-sdk-go-v2/internal/sdkio"

Index

Constants

const (
	// Byte is 8 bits
	Byte int64 = 1
	// KibiByte (KiB) is 1024 Bytes
	KibiByte = Byte * 1024
	// MebiByte (MiB) is 1024 KiB
	MebiByte = KibiByte * 1024
	// GibiByte (GiB) is 1024 MiB
	GibiByte = MebiByte * 1024
)

Types

type RingBuffer

type RingBuffer struct {
	// contains filtered or unexported fields
}

RingBuffer struct satisfies io.ReadWrite interface.

ReadBuffer is a revolving buffer data structure, which can be used to store snapshots of data in a revolving window.

func NewRingBuffer

func NewRingBuffer(slice []byte) *RingBuffer

NewRingBuffer method takes in a byte slice as an input and returns a RingBuffer.

func (*RingBuffer) Read

func (r *RingBuffer) Read(p []byte) (int, error)

Read copies the data on the ring buffer into the byte slice provided to the method. Returns the read count along with Error encountered while reading

func (*RingBuffer) Write

func (r *RingBuffer) Write(p []byte) (int, error)

Write method inserts the elements in a byte slice, and returns the number of bytes written along with an error.

Source Files

byte.go ringbuffer.go

Version
v1.1.0
Published
Jan 29, 2021
Platform
windows/amd64
Imports
1 packages
Last checked
2 minutes ago

Tools for package owners.