Class BrotliOutputStream
java.lang.Object
java.io.OutputStream
com.aayushatharva.brotli4j.encoder.BrotliOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
Output stream that wraps native brotli encoder.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intThe default internal buffer size used by the encoder.private final Encoder -
Constructor Summary
ConstructorsConstructorDescriptionBrotliOutputStream(OutputStream destination) Creates a BrotliOutputStream.BrotliOutputStream(OutputStream destination, Encoder.Parameters params) Creates a BrotliOutputStream.BrotliOutputStream(OutputStream destination, Encoder.Parameters params, int bufferSize) Creates a BrotliOutputStream. -
Method Summary
Modifier and TypeMethodDescriptionvoidattachDictionary(PreparedDictionary dictionary) voidclose()voidflush()voidwrite(byte[] b) voidwrite(byte[] b, int off, int len) voidwrite(int b)
-
Field Details
-
DEFAULT_BUFFER_SIZE
private static final int DEFAULT_BUFFER_SIZEThe default internal buffer size used by the encoder.- See Also:
-
encoder
-
-
Constructor Details
-
BrotliOutputStream
public BrotliOutputStream(OutputStream destination, Encoder.Parameters params, int bufferSize) throws IOException Creates a BrotliOutputStream.- Parameters:
destination- underlying destinationparams- encoding settingsbufferSize- intermediate buffer size- Throws:
IOException- If any failure during initialization
-
BrotliOutputStream
Creates a BrotliOutputStream.- Parameters:
destination- underlying destinationparams- encoding settings- Throws:
IOException- If any failure during initialization
-
BrotliOutputStream
Creates a BrotliOutputStream.- Parameters:
destination- underlying destination- Throws:
IOException- If any failure during initialization
-
-
Method Details
-
attachDictionary
- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-