Add object compression support (#6292)

Add support for streaming (golang/LZ77/snappy) compression.
This commit is contained in:
Praveen raj Mani
2018-09-28 09:06:17 +05:30
committed by Nitish Tiwari
parent 5c765bc63e
commit ce9d36d954
57 changed files with 1321 additions and 173 deletions

View File

@@ -138,7 +138,7 @@ func NewBufferedWriter(w io.Writer) *Writer {
}
}
// Writer is an io.Writer than can write Snappy-compressed bytes.
// Writer is an io.Writer that can write Snappy-compressed bytes.
type Writer struct {
w io.Writer
err error

View File

@@ -26,4 +26,4 @@ func extendMatch(src []byte, i, j int) int
// encodeBlock has the same semantics as in encode_other.go.
//
//go:noescape
func encodeBlock(dst, src []byte) (d int)
func encodeBlock(dst, src []byte) (d int)

View File

@@ -2,10 +2,21 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package snappy implements the snappy block-based compression format.
// It aims for very high speeds and reasonable compression.
// Package snappy implements the Snappy compression format. It aims for very
// high speeds and reasonable compression.
//
// The C++ snappy implementation is at https://github.com/google/snappy
// There are actually two Snappy formats: block and stream. They are related,
// but different: trying to decompress block-compressed data as a Snappy stream
// will fail, and vice versa. The block format is the Decode and Encode
// functions and the stream format is the Reader and Writer types.
//
// The block format, the more common case, is used when the complete size (the
// number of bytes) of the original data is known upfront, at the time
// compression starts. The stream format, also known as the framing format, is
// for when that isn't always true.
//
// The canonical, C++ implementation is at https://github.com/google/snappy and
// it only implements the block format.
package snappy // import "github.com/golang/snappy"
import (

6
vendor/vendor.json vendored
View File

@@ -359,10 +359,10 @@
"revisionTime": "2018-04-30T18:52:41Z"
},
{
"checksumSHA1": "W+E/2xXcE1GmJ0Qb784ald0Fn6I=",
"checksumSHA1": "h1d2lPZf6j2dW/mIqVnd1RdykDo=",
"path": "github.com/golang/snappy",
"revision": "d9eb7a3d35ec988b8585d4a0068e462c27d28380",
"revisionTime": "2016-05-29T05:00:41Z"
"revision": "2e65f85255dbc3072edf28d6b5b8efc472979f5a",
"revisionTime": "2018-05-18T05:39:59Z"
},
{
"checksumSHA1": "0x0CoHbgoWngucjKSDPFodeL8ek=",