Potential bug due to unnecessary cast from long to int

The `FSDataInputStreamWrapper`  accepts an int, but the length is a long (and all methods passing the length are passing long.