Package org.apache.parquet.bytes
Class ConcatenatingByteBufferCollector
- java.lang.Object
-
- org.apache.parquet.bytes.BytesInput
-
- org.apache.parquet.bytes.ConcatenatingByteBufferCollector
-
- All Implemented Interfaces:
AutoCloseable
public class ConcatenatingByteBufferCollector extends BytesInput implements AutoCloseable
Alternative toConcatenatingByteArrayCollectorbut usingByteBuffers allocated by itsByteBufferAllocator.
-
-
Constructor Summary
Constructors Constructor Description ConcatenatingByteBufferCollector(ByteBufferAllocator allocator)Constructs a newConcatenatingByteBufferCollectorinstance with the specified allocator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidcollect(BytesInput bytesInput)Collects the content of the specified input.StringmemUsageString(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 Detail
-
ConcatenatingByteBufferCollector
public ConcatenatingByteBufferCollector(ByteBufferAllocator allocator)
Constructs a newConcatenatingByteBufferCollectorinstance with the specified allocator.- Parameters:
allocator- to be used for allocating the requiredByteBufferinstances
-
-
Method Detail
-
collect
public void collect(BytesInput bytesInput)
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
public void writeAllTo(OutputStream out) throws IOException
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
public void writeInto(ByteBuffer buffer)
-
size
public long size()
- Specified by:
sizein classBytesInput- Returns:
- the size in bytes that would be written
-
-