github.com/segmentio/parquet-go@v0.0.0-20230712180008-5d42db8f0d47/compress/uncompressed/uncompressed.go (about)

     1  // Package uncompressed provides implementations of the compression codec
     2  // interfaces as pass-through without applying any compression nor
     3  // decompression.
     4  package uncompressed
     5  
     6  import (
     7  	"github.com/segmentio/parquet-go/format"
     8  )
     9  
    10  type Codec struct {
    11  }
    12  
    13  func (c *Codec) String() string {
    14  	return "UNCOMPRESSED"
    15  }
    16  
    17  func (c *Codec) CompressionCodec() format.CompressionCodec {
    18  	return format.Uncompressed
    19  }
    20  
    21  func (c *Codec) Encode(dst, src []byte) ([]byte, error) {
    22  	return append(dst[:0], src...), nil
    23  }
    24  
    25  func (c *Codec) Decode(dst, src []byte) ([]byte, error) {
    26  	return append(dst[:0], src...), nil
    27  }