Node.Buffer.Immutable  
- Package
- purescript-node-buffer
- Repository
- purescript-node/purescript-node-buffer
Immutable buffers and associated operations.
#ImmutableBuffer Source
data ImmutableBufferAn immutable buffer that exists independently of any memory region or effect.
Instances
#compareParts Source
compareParts :: ImmutableBuffer -> ImmutableBuffer -> Offset -> Offset -> Offset -> Offset -> Effect Ordering#create Source
create :: Int -> ImmutableBufferCreates a new buffer of the specified size. Alias for alloc.
#alloc Source
alloc :: Int -> ImmutableBufferCreates a new buffer of the specified size.
#fromArray Source
fromArray :: Array Octet -> ImmutableBufferCreates a new buffer from an array of octets, sized to match the array.
#fromString Source
fromString :: String -> Encoding -> ImmutableBufferCreates a new buffer from a string with the specified encoding, sized to match the string.
#fromArrayBuffer Source
fromArrayBuffer :: ArrayBuffer -> ImmutableBufferCreates a buffer view from a JS ArrayByffer without copying data.
#read Source
read :: BufferValueType -> Offset -> ImmutableBuffer -> NumberReads a numeric value from a buffer at the specified offset.
#readString Source
readString :: Encoding -> Offset -> Offset -> ImmutableBuffer -> StringReads a section of a buffer as a string with the specified encoding.
#toString Source
toString :: Encoding -> ImmutableBuffer -> StringReads the buffer as a string with the specified encoding.
#toArray Source
toArray :: ImmutableBuffer -> Array OctetCreates an array of octets from a buffer's contents.
#toArrayBuffer Source
toArrayBuffer :: ImmutableBuffer -> ArrayBufferCreates an ArrayBuffer by copying a buffer's contents.
#getAtOffset Source
getAtOffset :: Offset -> ImmutableBuffer -> Maybe OctetReads an octet from a buffer at the specified offset.
#concat Source
concat :: Array ImmutableBuffer -> ImmutableBufferConcatenates a list of buffers.
#concat' Source
concat' :: Array ImmutableBuffer -> Int -> ImmutableBufferConcatenates a list of buffers, combining them into a new buffer of the specified length.
#slice Source
slice :: Offset -> Offset -> ImmutableBuffer -> ImmutableBufferCreates a new buffer slice that shares the memory of the original buffer.
#size Source
size :: ImmutableBuffer -> IntReturns the size of a buffer.