MCPcopy Create free account
hub / github.com/apache/orc / outputBuffer

Method outputBuffer

java/core/src/java/org/apache/orc/impl/OutStream.java:135–153  ·  view source on GitHub ↗

When a buffer is done, we send it to the receiver to store. If we are encrypting, encrypt the buffer before we pass it on. @param buffer the buffer to store

(ByteBuffer buffer)

Source from the content-addressed store, hash-verified

133 * @param buffer the buffer to store
134 */
135 void outputBuffer(ByteBuffer buffer) throws IOException {
136 if (cipher != null) {
137 ByteBuffer output = buffer.duplicate();
138 int len = buffer.remaining();
139 try {
140 int encrypted = cipher.update(buffer, output);
141 output.flip();
142 receiver.output(output);
143 if (encrypted != len) {
144 throw new IllegalArgumentException("Encryption of incomplete buffer "
145 + len + " -> " + encrypted + " in " + this);
146 }
147 } catch (ShortBufferException e) {
148 throw new IOException("Short buffer in encryption in " + this, e);
149 }
150 } else {
151 receiver.output(buffer);
152 }
153 }
154
155 /**
156 * Ensure that the cipher didn't save any data.

Callers 4

spillMethod · 0.95
commitCompressMethod · 0.80
abortCompressMethod · 0.80
resetMethod · 0.80

Calls 3

flipMethod · 0.80
outputMethod · 0.65
updateMethod · 0.45

Tested by

no test coverage detected