github.com/parquet-go/parquet-go@v0.21.1-0.20240501160520-b3c3a0c3ed6f/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/parquet-go/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  }