ecologylab.io
Class NIOTools

java.lang.Object
  extended by ecologylab.generic.Debug
      extended by ecologylab.io.NIOTools

public class NIOTools
extends Debug

Utility class for managing memory mapped buffers.

Author:
wolf

Constructor Summary
NIOTools()
           
 
Method Summary
static boolean clean(java.nio.ByteBuffer buffer)
          Really closes a MappedByteBuffer without the need to wait for garbage collection.
static boolean writeFile(java.io.File file, java.lang.StringBuilder buffy)
           
static boolean writeMemoryMapped(java.io.File file, java.lang.StringBuilder buffy)
           
 
Methods inherited from class ecologylab.generic.Debug
classSimpleName, closeLoggingFile, debug, debug, debug, debug, debugA, debugA, debugA, debugI, debugI, debugI, error, error, getClassName, getClassName, getInteractive, getPackageName, getPackageName, getPackageName, initialize, level, level, level, logToFile, print, print, println, println, println, println, println, println, printlnA, printlnA, printlnA, printlnI, printlnI, printlnI, printlnI, setLoggingFile, show, show, superString, toggleInteractive, toString, toString, warning, warning, weird, weird
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NIOTools

public NIOTools()
Method Detail

clean

public static boolean clean(java.nio.ByteBuffer buffer)
Really closes a MappedByteBuffer without the need to wait for garbage collection. Any problems with closing a buffer on Windows (the problem child in this case) will be logged as SEVERE to the logger of the package name. To force logging of errors, set the System property "org.geotools.io.debugBuffer" to "true".

Parameters:
buffer - See MappedByteBuffer
Returns:
true if the operation was successful, false otherwise.

writeMemoryMapped

public static boolean writeMemoryMapped(java.io.File file,
                                        java.lang.StringBuilder buffy)

writeFile

public static boolean writeFile(java.io.File file,
                                java.lang.StringBuilder buffy)