public class BundleWriter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static int |
INITIAL_BUFFER
Initial buffer size.
|
private static Logging |
LOG
Class logger for the bundle writer.
|
static int |
MAGIC
Random magic number.
|
Constructor and Description |
---|
BundleWriter() |
Modifier and Type | Method and Description |
---|---|
private java.nio.ByteBuffer |
ensureBuffer(int size,
java.nio.ByteBuffer buffer,
java.nio.channels.WritableByteChannel output)
Ensure the buffer is large enough.
|
private void |
flushBuffer(java.nio.ByteBuffer buffer,
java.nio.channels.WritableByteChannel output)
Flush the current write buffer to disk.
|
void |
writeBundleStream(BundleStreamSource source,
java.nio.channels.WritableByteChannel output)
Write a bundle stream to a file output channel.
|
private ByteBufferSerializer<?>[] |
writeHeader(BundleStreamSource source,
java.nio.ByteBuffer buffer,
java.nio.channels.WritableByteChannel output)
Write the header for the given stream to the stream.
|
private static final Logging LOG
private static final int INITIAL_BUFFER
public static final int MAGIC
public void writeBundleStream(BundleStreamSource source, java.nio.channels.WritableByteChannel output) throws java.io.IOException
source
- Data sourceoutput
- Output channeljava.io.IOException
- on IO errorsprivate void flushBuffer(java.nio.ByteBuffer buffer, java.nio.channels.WritableByteChannel output) throws java.io.IOException
buffer
- Buffer to writeoutput
- Output channeljava.io.IOException
- on IO errorsprivate java.nio.ByteBuffer ensureBuffer(int size, java.nio.ByteBuffer buffer, java.nio.channels.WritableByteChannel output) throws java.io.IOException
size
- Required size to addbuffer
- Existing bufferoutput
- Output channeljava.io.IOException
- on IO errorsprivate ByteBufferSerializer<?>[] writeHeader(BundleStreamSource source, java.nio.ByteBuffer buffer, java.nio.channels.WritableByteChannel output) throws java.io.IOException
source
- Bundle streambuffer
- Buffer to use for writingoutput
- Output channeljava.io.IOException
- on IO errorsCopyright © 2019 ELKI Development Team. License information.