Package org.apache.orc.impl
Class OutStream
java.lang.Object
java.io.OutputStream
org.apache.orc.impl.PositionedOutputStream
org.apache.orc.impl.OutStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
The output stream for writing to ORC files.
It handles both compression and encryption.
-
Field Summary
FieldsModifier and TypeFieldDescriptionLazily initialized: Won't allocate byte buffer until invocation of init()static final int -
Constructor Summary
ConstructorsConstructorDescriptionOutStream(Object name, StreamOptions options, PhysicalWriter.OutputReceiver receiver) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertBufferSizeValid(int bufferSize) Throws exception if the bufferSize argument equals or exceeds 2^(3*8 - 1).voidChange the current Initialization Vector (IV) for the encryption.voidflush()longGet the memory size currently allocated as buffer associated with this stream.voidgetPosition(PositionRecorder recorder) Record the current position to the recorder.voidsuppress()Set suppress flagtoString()voidwrite(byte[] bytes, int offset, int length) voidwrite(int i) Methods inherited from class java.io.OutputStream
close, nullOutputStream, write
-
Field Details
-
HEADER_SIZE
public static final int HEADER_SIZE- See Also:
-
compressedBuffer
Lazily initialized: Won't allocate byte buffer until invocation of init()
-
-
Constructor Details
-
OutStream
-
-
Method Details
-
changeIv
Change the current Initialization Vector (IV) for the encryption.- Specified by:
changeIvin classPositionedOutputStream- Parameters:
modifier- a function to modify the IV in place
-
assertBufferSizeValid
Throws exception if the bufferSize argument equals or exceeds 2^(3*8 - 1). SeewriteHeader(ByteBuffer, int, int, boolean). The bufferSize needs to be expressible in 3 bytes, and uses the least significant byte to indicate original/compressed bytes.- Parameters:
bufferSize- The ORC compression buffer size being checked.- Throws:
IllegalArgumentException- If bufferSize value exceeds threshold.
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
getPosition
Description copied from class:PositionedOutputStreamRecord the current position to the recorder.- Specified by:
getPositionin classPositionedOutputStream- Parameters:
recorder- the object that receives the position
-
flush
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
toString
-
getBufferSize
public long getBufferSize()Description copied from class:PositionedOutputStreamGet the memory size currently allocated as buffer associated with this stream.- Specified by:
getBufferSizein classPositionedOutputStream- Returns:
- the number of bytes used by buffers.
-
suppress
public void suppress()Set suppress flag
-