our $VERSION = '0.001001';
-sub create {
- my ($class) = @_;
- my $state = BrotliEncoderCreateInstance();
- bless \$state, $class
-}
-
-sub DESTROY {
- my ($self) = @_;
- BrotliEncoderDestroyInstance($$self)
-}
-
-sub quality {
- my ($self, $quality) = @_;
- BrotliEncoderSetQuality($$self, $quality)
-}
-
-sub window {
- my ($self, $window) = @_;
- BrotliEncoderSetWindow($$self, $window)
-}
-
my %BROTLI_ENCODER_MODE = ( generic => 0, text => 1, font => 2 );
sub mode {
my ($self, $mode) = @_;
die "Invalid encoder mode"
unless $BROTLI_ENCODER_MODE{$mode};
- BrotliEncoderSetMode($$self, $mode)
+ _mode($$self, $mode)
}
-use constant {
- BROTLI_OPERATION_PROCESS => 0,
- BROTLI_OPERATION_FLUSH => 1,
- BROTLI_OPERATION_FINISH => 2
-};
-sub compress {
- my ($self, $data) = @_;
- BrotliEncoderCompressStream($$self, $data, BROTLI_OPERATION_PROCESS )
-}
-
-sub flush {
- my ($self) = @_;
- BrotliEncoderCompressStream($$self, '', BROTLI_OPERATION_FLUSH )
-}
-
-sub finish {
- my ($self) = @_;
- BrotliEncoderCompressStream($$self, '', BROTLI_OPERATION_FINISH )
-}
-
-# Untested, probably not working
-sub set_dictionary {
- my ($self, $dict) = @_;
- BrotliEncoderSetCustomDictionary($$self, $dict)
-}
1;
__END__
=head1 NAME
-IO::Compress::Brotli - [Not yet implemented] Write Brotli buffers/streams
+IO::Compress::Brotli - Write Brotli buffers/streams
=head1 SYNOPSIS