Skip to content

Commit

Permalink
Merge pull request pinterest#71 from estezz/master
Browse files Browse the repository at this point in the history
using length of BytesWritable to decide how much of the byte array to di...
  • Loading branch information
pgarbacki committed Jan 16, 2015
2 parents 18fd1ec + e76d015 commit 6c469ae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/com/pinterest/secor/tools/LogFilePrinter.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ public void printFile(String path) throws Exception {
if (mPrintOffsetsOnly) {
System.out.println(Long.toString(key.get()));
} else {
System.out.println(Long.toString(key.get()) + ": " + new String(value.getBytes()));
byte[] nonPaddedBytes = new byte[value.getLength()];
System.arraycopy(value.getBytes(), 0, nonPaddedBytes, 0, value.getLength());
System.out.println(Long.toString(key.get()) + ": " + new String(nonPaddedBytes));
}
}
}
Expand Down

0 comments on commit 6c469ae

Please sign in to comment.