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
    Creates a new WriteBufferManager that writes to the specified file channel
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    flushes the cached contents into the channel.
    void
    Specifies the byte order.
    void
    put(byte b)
    Puts the specified byte at the current position
    void
    put(byte[] bs)
    Puts the specified bytes at the current position
    void
    putDouble(double d)
    Puts the specified double at the current position
    void
    putInt(int value)
    Puts the specified int at the current position

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • WriteBufferManager

      public WriteBufferManager(FileChannel channel) throws IOException
      Creates a new WriteBufferManager that writes to the specified file channel
      Parameters:
      channel -
      Throws:
      IOException
  • Method Details

    • put

      public void put(byte b) throws IOException
      Puts the specified byte at the current position
      Parameters:
      b -
      Throws:
      IOException
    • put

      public void put(byte[] bs) throws IOException
      Puts the specified bytes at the current position
      Parameters:
      bs -
      Throws:
      IOException
    • flush

      public void flush() throws IOException
      flushes 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 in ByteBuffer
      Parameters:
      order -
    • putInt

      public void putInt(int value) throws IOException
      Puts the specified int at the current position
      Parameters:
      value -
      Throws:
      IOException
    • putDouble

      public void putDouble(double d) throws IOException
      Puts the specified double at the current position
      Parameters:
      d -
      Throws:
      IOException