Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Bytes
- null :: Bytes -> Bool
- length :: Bytes -> Int
- takeWhile :: (Word8 -> Bool) -> Bytes -> Bytes
- dropWhile :: (Word8 -> Bool) -> Bytes -> Bytes
- unsafeTake :: Int -> Bytes -> Bytes
- unsafeDrop :: Int -> Bytes -> Bytes
- toByteArray :: Bytes -> ByteArray
- toByteArrayClone :: Bytes -> ByteArray
- fromAsciiString :: String -> Bytes
- fromByteArray :: ByteArray -> Bytes
Types
A slice of a ByteArray
.
Properties
Filtering
Unsafe Slicing
unsafeTake :: Int -> Bytes -> Bytes Source #
Take the first n
bytes from the argument. Precondition: n ≤ len
unsafeDrop :: Int -> Bytes -> Bytes Source #
Drop the first n
bytes from the argument. Precondition: n ≤ len
Conversion
toByteArray :: Bytes -> ByteArray Source #
toByteArrayClone :: Bytes -> ByteArray Source #
Variant of toByteArray
that unconditionally makes a copy of
the array backing the sliced Bytes
even if the original array
could be reused. Prefer toByteArray
.