changed the FSDataOutput and InputStream creation