Package org.apache.parquet.bytes
Class ConcatenatingByteBufferCollector
java.lang.Object
org.apache.parquet.bytes.BytesInput
org.apache.parquet.bytes.ConcatenatingByteBufferCollector
- All Implemented Interfaces:
AutoCloseable
Alternative to
ConcatenatingByteArrayCollector but using ByteBuffers allocated by its
ByteBufferAllocator.-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newConcatenatingByteBufferCollectorinstance with the specified allocator. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidcollect(BytesInput bytesInput) Collects the content of the specified input.memUsageString(String prefix) longsize()voidwriteAllTo(OutputStream out) writes the bytes into a streamvoidwriteInto(ByteBuffer buffer) Methods inherited from class org.apache.parquet.bytes.BytesInput
concat, concat, copy, copy, copy, empty, from, from, from, from, from, from, from, from, fromInt, fromUnsignedVarInt, fromUnsignedVarLong, fromZigZagVarInt, fromZigZagVarLong, toByteArray, toByteBuffer, toByteBuffer, toByteBuffer, toInputStream
-
Constructor Details
-
ConcatenatingByteBufferCollector
Constructs a newConcatenatingByteBufferCollectorinstance with the specified allocator.- Parameters:
allocator- to be used for allocating the requiredByteBufferinstances
-
-
Method Details
-
collect
Collects the content of the specified input. It allocates a newByteBufferinstance that can contain all the content.- Parameters:
bytesInput- the input which content is to be collected
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
writeAllTo
Description copied from class:BytesInputwrites the bytes into a stream- Specified by:
writeAllToin classBytesInput- Parameters:
out- an output stream- Throws:
IOException- if there is an exception writing
-
writeInto
-
size
public long size()- Specified by:
sizein classBytesInput- Returns:
- the size in bytes that would be written
-
memUsageString
- Parameters:
prefix- a prefix to be used for every new line in the string- Returns:
- a text representation of the memory usage of this structure
-