Skip to content

Commit

Permalink
Cleanup of code
Browse files Browse the repository at this point in the history
  • Loading branch information
abradle committed Aug 29, 2016
1 parent 3bd2dd0 commit f452be2
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions mmtf-codec/src/main/java/org/rcsb/mmtf/encoder/WriterUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public static void writeDataToFile(AdapterToStructureData writerToEncoder, Path
*/
public static byte[] getDataAsByteArr(AdapterToStructureData writerToEncoder) throws IOException {
MessagePackSerialization mmtfBeanSeDerializerInterface = new MessagePackSerialization();
// Get to bean
GenericEncoder genericEncoder = new GenericEncoder(writerToEncoder);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
mmtfBeanSeDerializerInterface.serialize(genericEncoder.getMmtfEncodedStructure(), bos);
Expand All @@ -53,13 +52,10 @@ public static byte[] getDataAsByteArr(AdapterToStructureData writerToEncoder) th
* @throws IOException an exception creating the GZIP stream
*/
public static byte[] gzipCompress(byte[] byteArray) throws IOException {
// Function to gzip compress the data for the hashmaps
ByteArrayOutputStream byteStream =
new ByteArrayOutputStream(byteArray.length);
ByteArrayOutputStream byteStream = new ByteArrayOutputStream(byteArray.length);
try
{
GZIPOutputStream zipStream =
new GZIPOutputStream(byteStream);
GZIPOutputStream zipStream = new GZIPOutputStream(byteStream);
try
{
zipStream.write(byteArray);
Expand All @@ -73,7 +69,6 @@ public static byte[] gzipCompress(byte[] byteArray) throws IOException {
{
byteStream.close();
}
byte[] compressedData = byteStream.toByteArray();
return compressedData;
return byteStream.toByteArray();
}
}

0 comments on commit f452be2

Please sign in to comment.