read :: FileSystem -> File -> Int -> IO SB.ByteString
read (FileSystem fs) (File f) len =
  allocaArray len $ \buf -> do
    nread <- throwErrnoIfMinus1 "read" $
               c_hdfs_read fs f buf (fromIntegral len)
    SB.packCStringLen (buf, fromIntegral nread)
read :: FileSystem -> File -> Int -> IO SB.ByteString
read (FileSystem fs) (File f) len =
  allocaArray len $ \buf -> do
    nread <- throwErrnoIfMinus1 "read" $
               c_hdfs_read fs f buf (fromIntegral len)
    SB.packCStringLen (buf, fromIntegral nread)
read (FileSystem fs) (File f) len =
  allocaArray len $ \buf -> do
    nread <- throwErrnoIfMinus1 "read" $
               c_hdfs_read fs f buf (fromIntegral len)
    SB.packCStringLen (buf, fromIntegral nread)