public final class HeaderlessChannelWriterOutputView extends AbstractChannelWriterOutputView
DataOutputView
that is backed by a BlockChannelWriter
, making it effectively a data output stream. The view writes its data in
blocks to the underlying channel, but does not expect header for each block.headerLength, segmentSize
Constructor and Description |
---|
HeaderlessChannelWriterOutputView(BlockChannelWriter<MemorySegment> writer,
List<MemorySegment> memory,
int segmentSize) |
Modifier and Type | Method and Description |
---|---|
int |
close()
Closes this OutputView, closing the underlying writer.
|
int |
getBlockCount()
Gets the number of blocks used by this view.
|
FileIOChannel |
getChannel()
Get the underlying channel.
|
long |
getNumBytes()
Get output bytes.
|
long |
getNumCompressedBytes()
Get output compressed bytes, return num bytes if there is no compression.
|
MemorySegment |
nextSegment(MemorySegment current,
int posInSegment)
This method must return a segment.
|
advance, clear, getCurrentPositionInSegment, getCurrentSegment, getHeaderLength, getSegmentSize, seekOutput, skipBytesToWrite, write, write, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
public HeaderlessChannelWriterOutputView(BlockChannelWriter<MemorySegment> writer, List<MemorySegment> memory, int segmentSize)
public FileIOChannel getChannel()
AbstractChannelWriterOutputView
getChannel
in class AbstractChannelWriterOutputView
public int close() throws IOException
close
in class AbstractChannelWriterOutputView
IOException
public int getBlockCount()
AbstractChannelWriterOutputView
getBlockCount
in class AbstractChannelWriterOutputView
public long getNumBytes() throws IOException
AbstractChannelWriterOutputView
getNumBytes
in class AbstractChannelWriterOutputView
IOException
public long getNumCompressedBytes() throws IOException
AbstractChannelWriterOutputView
getNumCompressedBytes
in class AbstractChannelWriterOutputView
IOException
public MemorySegment nextSegment(MemorySegment current, int posInSegment) throws IOException
AbstractPagedOutputView
EOFException
.nextSegment
in class AbstractPagedOutputView
current
- The current memory segmentposInSegment
- The position in the segment, one after the last valid byte.IOException
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.