NOTE: The ByteArray interface is deprecated, please use IArray (Section 4.17) or MArray (Section 4.21) instead.
ByteArrays are chunks of immutable Haskell heap:
data ByteArray ix -- abstract instance Eq (ByteArray ix) newByteArray :: Ix ix => (ix,ix) -> ST s (ByteArray ix) indexCharArray :: Ix ix => ByteArray ix -> ix -> Char indexIntArray :: Ix ix => ByteArray ix -> ix -> Int indexWordArray :: Ix ix => ByteArray ix -> ix -> Word indexAddrArray :: Ix ix => ByteArray ix -> ix -> Addr indexFloatArray :: Ix ix => ByteArray ix -> ix -> Float indexDoubleArray :: Ix ix => ByteArray ix -> ix -> Double indexStablePtrArray :: Ix ix => ByteArray ix -> ix -> (StablePtr a) sizeofByteArray :: Ix ix => ByteArray ix -> Int boundsOfByteArray :: Ix ix => ByteArray ix -> (ix, ix) |
Remarks:
The operation newByteArray creates a byte array of length equal to the range of its indices in bytes.
sizeofByteArray returns the size of the byte array, in bytes.
Equality on byte arrays is value equality, not pointer equality (as is the case for its mutable variant.) Two byte arrays are equal if they're of the same length and they're pairwise equal.