Package org.h2gis.functions.io.utility
Class WriteBufferManager
- java.lang.Object
-
- org.h2gis.functions.io.utility.WriteBufferManager
-
public final class WriteBufferManager extends Object
Class to write files using nio.- Author:
- Fernando Gonzalez Cortes
-
-
Constructor Summary
Constructors Constructor Description WriteBufferManager(FileChannel channel)Creates a new WriteBufferManager that writes to the specified file channel
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidflush()flushes the cached contents into the channel.voidorder(ByteOrder order)Specifies the byte order.voidput(byte b)Puts the specified byte at the current positionvoidput(byte[] bs)Puts the specified bytes at the current positionvoidputDouble(double d)Puts the specified double at the current positionvoidputInt(int value)Puts the specified int at the current position
-
-
-
Constructor Detail
-
WriteBufferManager
public WriteBufferManager(FileChannel channel) throws IOException
Creates a new WriteBufferManager that writes to the specified file channel- Parameters:
channel-- Throws:
IOException
-
-
Method Detail
-
put
public void put(byte b) throws IOExceptionPuts the specified byte at the current position- Parameters:
b-- Throws:
IOException
-
put
public void put(byte[] bs) throws IOExceptionPuts the specified bytes at the current position- Parameters:
bs-- Throws:
IOException
-
flush
public void flush() throws IOExceptionflushes the cached contents into the channel. It is mandatory to call this method to finish the writing of the channel- Throws:
IOException
-
order
public void order(ByteOrder order)
Specifies the byte order. One of the constants inByteBuffer- Parameters:
order-
-
putInt
public void putInt(int value) throws IOExceptionPuts the specified int at the current position- Parameters:
value-- Throws:
IOException
-
putDouble
public void putDouble(double d) throws IOExceptionPuts the specified double at the current position- Parameters:
d-- Throws:
IOException
-
-