In Data.Binary.Put, there is putShortByteString :: ShortByteString -> Put.
However, there is no corresponding getShortByteString :: Int -> Get ShortByteString in Data.Binary.Get.
A naive implementation would be:
getShortByteString :: Int -> Get ShortByteString
getShortByteString = fmap BS.toShort . getByteString
But maybe there is a better way?
In
Data.Binary.Put, there isputShortByteString :: ShortByteString -> Put.However, there is no corresponding
getShortByteString :: Int -> Get ShortByteStringinData.Binary.Get.A naive implementation would be:
But maybe there is a better way?