1
// Copyright 2011 The Go Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style
3
// license that can be found in the LICENSE file.
8
"code.google.com/p/go.crypto/openpgp/errors"
16
// Compressed represents a compressed OpenPGP packet. The decompressed contents
17
// will contain more OpenPGP packets. See RFC 4880, section 5.6.
18
type Compressed struct {
22
func (c *Compressed) parse(r io.Reader) error {
24
_, err := readFull(r, buf[:])
31
c.Body = flate.NewReader(r)
33
c.Body, err = zlib.NewReader(r)
35
c.Body = bzip2.NewReader(r)
37
err = errors.UnsupportedError("unknown compression algorithm: " + strconv.Itoa(int(buf[0])))