-
Notifications
You must be signed in to change notification settings - Fork 0
/
util.go
37 lines (31 loc) · 1.17 KB
/
util.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package compress
import "io"
func Mark1Compress16(input []byte, output io.Writer) {
data, channel := make([]byte, len(input)), make(chan []byte, 1)
copy(data, input)
channel <- data
close(channel)
BijectiveBurrowsWheelerCoder(channel).MoveToFrontRunLengthCoder().AdaptiveCoder().Code(output)
}
func Mark1Decompress16(input io.Reader, output []byte) {
channel := make(chan []byte, 1)
channel <- output
close(channel)
BijectiveBurrowsWheelerDecoder(channel).MoveToFrontRunLengthDecoder().AdaptiveDecoder().Decode(input)
}
func Mark1Compress1(input []byte, output io.Writer) {
data, channel := make([]byte, len(input)), make(chan []byte, 1)
copy(data, input)
channel <- data
close(channel)
BijectiveBurrowsWheelerCoder(channel).MoveToFrontCoder().FilteredAdaptiveBitCoder().Code(output)
}
func Mark1Decompress1(input io.Reader, output []byte) {
channel := make(chan []byte, 1)
channel <- output
close(channel)
BijectiveBurrowsWheelerDecoder(channel).MoveToFrontDecoder().FilteredAdaptiveBitDecoder().Decode(input)
}