public abstract class CompressedStreamOutput<T extends CompressorContext> extends StreamOutput
Modifier and Type | Field and Description |
---|---|
protected T |
context |
protected byte[] |
uncompressed |
protected int |
uncompressedLength |
Constructor and Description |
---|
CompressedStreamOutput(StreamOutput out,
T context) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this stream to further operations.
|
protected abstract void |
compress(byte[] data,
int offset,
int len,
StreamOutput out)
Compresses the data into the output
|
protected abstract void |
doClose() |
void |
flush()
Forces any buffered output to be written.
|
void |
reset() |
StreamOutput |
setVersion(Version version) |
void |
write(int b) |
void |
writeByte(byte b)
Writes a single byte.
|
void |
writeBytes(byte[] input,
int offset,
int length)
Writes an array of bytes.
|
protected abstract void |
writeHeader(StreamOutput out) |
getVersion, position, seek, seekPositionSupported, write, writeBoolean, writeBytes, writeBytes, writeBytesRef, writeBytesReference, writeDouble, writeDoubleArray, writeFloat, writeFloatArray, writeGenericValue, writeInt, writeIntArray, writeLong, writeLongArray, writeMap, writeOptionalBoolean, writeOptionalSharedString, writeOptionalStreamable, writeOptionalString, writeOptionalText, writeSharedString, writeSharedText, writeShort, writeString, writeStringArray, writeStringArrayNullable, writeText, writeTextArray, writeVInt, writeVLong
write
protected final T extends CompressorContext context
protected byte[] uncompressed
protected int uncompressedLength
public CompressedStreamOutput(StreamOutput out, T context) throws IOException
IOException
public StreamOutput setVersion(Version version)
setVersion
in class StreamOutput
public void write(int b) throws IOException
write
in class StreamOutput
IOException
public void writeByte(byte b) throws IOException
StreamOutput
writeByte
in class StreamOutput
IOException
public void writeBytes(byte[] input, int offset, int length) throws IOException
StreamOutput
writeBytes
in class StreamOutput
input
- the bytes to writeoffset
- the offset in the byte arraylength
- the number of bytes to writeIOException
public void flush() throws IOException
StreamOutput
flush
in interface Flushable
flush
in class StreamOutput
IOException
public void close() throws IOException
StreamOutput
close
in interface Closeable
close
in interface AutoCloseable
close
in class StreamOutput
IOException
protected abstract void doClose() throws IOException
IOException
public void reset() throws IOException
reset
in class StreamOutput
IOException
protected abstract void writeHeader(StreamOutput out) throws IOException
IOException
protected abstract void compress(byte[] data, int offset, int len, StreamOutput out) throws IOException
IOException
Copyright © 2009–2015. All rights reserved.