Module

Node.Buffer

Mutable buffers and associated operations.

#Buffer

data Buffer

A reference to a mutable buffer for use with Effect

Instances

#create

create :: Int -> Effect Buffer

Creates a new buffer of the specified size. Alias to alloc.

#alloc

alloc :: Int -> Effect Buffer

Creates a new buffer of the specified size.

#allocUnsafe

allocUnsafe :: Int -> Effect Buffer

Creates a new buffer of the specified size. Unsafe because it reuses memory from a pool and may contain sensitive data. See the Node docs: https://nodejs.org/docs/latest-v18.x/api/buffer.html#what-makes-bufferallocunsafe-and-bufferallocunsafeslow-unsafe

#allocUnsafeSlow

allocUnsafeSlow :: Int -> Effect Buffer

Creates a new buffer of the specified size. Unsafe because it reuses memory from a pool and may contain sensitive data. See the Node docs: https://nodejs.org/docs/latest-v18.x/api/buffer.html#what-makes-bufferallocunsafe-and-bufferallocunsafeslow-unsafe

#compareParts

#fromArray

#fromString

#fromArrayBuffer

#toArrayBuffer

#readString

#toString

#toString'

#writeString

#toArray

#getAtOffset

#setAtOffset

#slice

#size

#concat'

#copy

#fill

#poolSize

poolSize :: Effect (Int)

The size (in bytes) of pre-allocated internal Buffer instances used for pooling. This value may be modified.

#setPoolSize

#swap16

#swap32

#swap64

Re-exports from Node.Buffer.Types

#Offset

type Offset = Int

Type synonym indicating the value refers to an offset in a buffer.

#Octet

type Octet = Int

Type synonym indicating the value should be an octet (0-255). If the value provided is outside this range it will be used as modulo 256.

#BufferValueType

data BufferValueType

Enumeration of the numeric types that can be written to a buffer.

Constructors

Instances

Modules