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, writeByteArray, 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, writeVLongwriteprotected final T extends CompressorContext context
protected byte[] uncompressed
protected int uncompressedLength
public CompressedStreamOutput(StreamOutput out, T context) throws IOException
IOExceptionpublic StreamOutput setVersion(Version version)
setVersion in class StreamOutputpublic void write(int b)
throws IOException
write in class StreamOutputIOExceptionpublic void writeByte(byte b)
throws IOException
StreamOutputwriteByte in class StreamOutputIOExceptionpublic void writeBytes(byte[] input,
int offset,
int length)
throws IOException
StreamOutputwriteBytes in class StreamOutputinput - the bytes to writeoffset - the offset in the byte arraylength - the number of bytes to writeIOExceptionpublic void flush()
throws IOException
StreamOutputflush in interface Flushableflush in class StreamOutputIOExceptionpublic void close()
throws IOException
StreamOutputclose in interface Closeableclose in interface AutoCloseableclose in class StreamOutputIOExceptionprotected abstract void doClose()
throws IOException
IOExceptionpublic void reset()
throws IOException
reset in class StreamOutputIOExceptionprotected abstract void writeHeader(StreamOutput out) throws IOException
IOExceptionprotected abstract void compress(byte[] data,
int offset,
int len,
StreamOutput out)
throws IOException
IOExceptionCopyright © 2009–2016. All rights reserved.