Could you just extend org.apache.hadoop.io.compress.SnappyCodec and override this method?