fdWriteArray :: Fd -> ByteAddr -> ArrayRange (STPrimArray RealWorld Pinned Word8) -> ExceptT String IO ()
fdWriteArray fd start a = ExceptT $ fmap (boolEither "" () . (==) (toByteCount $ arrayLen a)) $
                          fdSeekLen fd start >> withArrayPtr (\ptr len -> fdWriteBuf fd ptr $ toByteCount len) a
fdWriteArray :: Fd -> ByteAddr -> ArrayRange (STPrimArray RealWorld Pinned Word8) -> ExceptT String IO ()
fdWriteArray fd start a = ExceptT $ fmap (boolEither "" () . (==) (toByteCount $ arrayLen a)) $
                          fdSeekLen fd start >> withArrayPtr (\ptr len -> fdWriteBuf fd ptr $ toByteCount len) a
fdWriteArray fd start a = ExceptT $ fmap (boolEither "" () . (==) (toByteCount $ arrayLen a)) $
                          fdSeekLen fd start >> withArrayPtr (\ptr len -> fdWriteBuf fd ptr $ toByteCount len) a