diff --git a/go/cbrotli/cgo.go b/go/cbrotli/cgo.go new file mode 100755 index 0000000..f953f72 --- /dev/null +++ b/go/cbrotli/cgo.go @@ -0,0 +1,13 @@ +// Copyright 2017 Google Inc. All Rights Reserved. +// +// Distributed under MIT license. +// See file LICENSE for detail or copy at https://opensource.org/licenses/MIT + +package cbrotli + +// Inform golang build system that it should link brotli libraries. + +// #cgo LDFLAGS: -lbrotlicommon +// #cgo LDFLAGS: -lbrotlidec +// #cgo LDFLAGS: -lbrotlienc +import "C" diff --git a/go/cbrotli/writer.go b/go/cbrotli/writer.go index 279a2f2..9fa75ab 100755 --- a/go/cbrotli/writer.go +++ b/go/cbrotli/writer.go @@ -56,9 +56,6 @@ type WriterOptions struct { // LGWin is the base 2 logarithm of the sliding window size. // Range is 10 to 24. 0 indicates automatic configuration based on Quality. LGWin int - // BufferSize is the number of bytes to use to buffer encoded output. - // 0 indicates an implementation-defined default. - BufferSize int } // Writer implements io.WriteCloser by writing Brotli-encoded data to an @@ -80,8 +77,10 @@ func NewWriter(dst io.Writer, options WriterOptions) *Writer { state := C.BrotliEncoderCreateInstance(nil, nil, nil) C.BrotliEncoderSetParameter( state, C.BROTLI_PARAM_QUALITY, (C.uint32_t)(options.Quality)) - C.BrotliEncoderSetParameter( - state, C.BROTLI_PARAM_LGWIN, (C.uint32_t)(options.LGWin)) + if options.LGWin > 0 { + C.BrotliEncoderSetParameter( + state, C.BROTLI_PARAM_LGWIN, (C.uint32_t)(options.LGWin)) + } return &Writer{ dst: dst, state: state, diff --git a/java/org/brotli/dec/BUILD b/java/org/brotli/dec/BUILD index 32c5897..cd5d8d1 100755 --- a/java/org/brotli/dec/BUILD +++ b/java/org/brotli/dec/BUILD @@ -11,6 +11,7 @@ java_library( ["*.java"], exclude = ["*Test*.java"], ), + proguard_specs = ["proguard.cfg"], ) java_library( diff --git a/java/org/brotli/dec/proguard.cfg b/java/org/brotli/dec/proguard.cfg new file mode 100755 index 0000000..b5f047e --- /dev/null +++ b/java/org/brotli/dec/proguard.cfg @@ -0,0 +1,2 @@ +# DictionaryData is an optionally / dynamically loaded built-in dictionary. +-keep class org.brotli.dec.DictionaryData