Skip to content

Commit

Permalink
Remove the compression and deserializing annotations. They lead to wa…
Browse files Browse the repository at this point in the history
…y too many annotations and make it hard to see what is actually going on.

Author: @johanoskarsson
Fixes #74
URL: #74
  • Loading branch information
johanoskarsson committed Jul 18, 2012
1 parent 25a311d commit 72900b6
Showing 1 changed file with 0 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class SnappyCodec[T](codec: Codec[T]) extends Codec[T] {

def encode(t: T): ByteBuffer = {
Stats.time("snappycodec.compress") {
Trace.record("snappycodec.compress")
val arr = Util.getArrayFromBuffer(codec.encode(t))
val compressArr = new Array[Byte](Snappy.maxCompressedLength(arr.length))
val compressLen = Snappy.compress(arr, 0, arr.length, compressArr, 0)
Expand All @@ -44,7 +43,6 @@ class SnappyCodec[T](codec: Codec[T]) extends Codec[T] {

def decode(ary: ByteBuffer): T = {
Stats.time("snappycodec.decompress") {
Trace.record("snappycodec.decompress")
val arr = Util.getArrayFromBuffer(ary)
val uncompressedArr = Snappy.uncompress(arr, 0, arr.length)
codec.decode(ByteBuffer.wrap(uncompressedArr))
Expand Down

0 comments on commit 72900b6

Please sign in to comment.