Skip to content

Commit

Permalink
Merge pull request #28 from andreasprlic/master
Browse files Browse the repository at this point in the history
more standard way of getting an InputStream
  • Loading branch information
josemduarte committed Mar 7, 2017
2 parents 7d9a709 + 7949dc0 commit 8aa07a8
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions mmtf-codec/src/main/java/org/rcsb/mmtf/decoder/ReaderUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,8 @@ public static byte[] deflateGzip(byte[] inputBytes) throws IOException {
* @throws IOException an error reading the file
*/
public static MmtfStructure getDataFromFile(Path filePath) throws IOException {
// Now return the gzip deflated and deserialized byte array
return getDataFromInputStream(new ByteArrayInputStream(readFile(filePath)));
}

/**
* Read a byte array from a file
* @param path the input file path
* @return the returned byte array
* @throws IOException an error reading the file
*/
private static byte[] readFile(Path path) throws IOException {
byte[] data = Files.readAllBytes(path);
return data;
return getDataFromInputStream(Files.newInputStream(filePath));
}

/**
Expand Down

0 comments on commit 8aa07a8

Please sign in to comment.