Documentation
¶
Overview ¶
Copyright 2015-2016 Joel Scoble. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- func Compress(format string, r io.Reader, w io.Writer) (int64, error)
- func CompressGZip(r io.Reader, w io.Writer) (int64, error)
- func CompressLZ4(r io.Reader, w io.Writer) (int64, error)
- func CompressionFormat(r io.ReaderAt) (compress.Format, error)
- func CompressionIsSupported(f compress.Format) bool
- func Decompress(r io.Reader, w io.Writer) (int64, error)
- func DecompressBZip2(r io.Reader, w io.Writer) (int64, error)
- func DecompressGZip(r io.Reader, w io.Writer) (int64, error)
- func DecompressLZ4(r io.Reader, w io.Writer) (int64, error)
- func DecompressionIsSupported(f compress.Format) bool
Constants ¶
This section is empty.
Variables ¶
var ( ErrUnsupported = errors.New("unsupported compression format") ErrNoFormat = errors.New("no compression format specified") )
Functions ¶
func Compress ¶
Compress is the handler for compression. Bytes read is returned along with any non io.EOF error that may have occurred.
func CompressGZip ¶
CompressGzip compresses using gzip compression. Bytes read is returned along with any non io.EOF error that may have occurred.
func CompressLZ4 ¶
CompressLZ4 compresses using lz4 compression. Bytes read is returned along with any non io.EOF error that may have occurred.
func CompressionFormat ¶
CompressionFormat checks to see if the data in the provided reader uses a supported compression format. If it does not, an UnsupportedErr is returned.
func CompressionIsSupported ¶
CompressionIsSupported returns if compression using the Format is supported.
func Decompress ¶
Decompress is the handler for decompression. The decompression format to use is determined by the magic bytes within the data. If no match is found, an ErrUnsupported is returned. Bytes read is returned along with any non io.EOF error that may have occurred. If the reader doesn't implement io.ReaderAt a panic will occur.
func DecompressBZip2 ¶
DecompressBZip2 decompresses data compressed with bzip2 compression. Bytes read is returned along with any non io.EOF error that may have occurred.
func DecompressGZip ¶
DecompressGZip decompresses data compressed with gzip compression. Bytes read is returned along with any non io.EOF error that may have occurred.
func DecompressLZ4 ¶
DecompressLZ4 decompresses data compressed with lz4 compression. Bytes read is returned along with any non io.EOF error that may have occurred.
func DecompressionIsSupported ¶
Returns if the format is supported for decompression.
Types ¶
This section is empty.