use of com.questdb.std.ex.JournalNetworkException in project questdb by bluestreak01.
the class HugeBufferProducer method write.
@Override
public void write(WritableByteChannel channel) throws JournalNetworkException {
long target = hb.getAppendOffset();
Unsafe.getUnsafe().putLong(headerAddress, target);
header.position(0);
try {
channel.write(header);
long pos = 0;
while (pos < target) {
pos += ByteBuffers.copy(hb.getBuffer(pos), channel, target - pos);
}
} catch (IOException e) {
throw new JournalNetworkException(e);
}
}
Aggregations