org.h2.store.fs
Class FileObjectDiskMapped

java.lang.Object
  extended by org.h2.store.fs.FileObjectDiskMapped
All Implemented Interfaces:
FileObject

public class FileObjectDiskMapped
extends java.lang.Object
implements FileObject

FileObject which is using NIO MappedByteBuffer mapped to memory from file.


Method Summary
 void close()
          Close the file.
 long getFilePointer()
          Get the file pointer.
 java.lang.String getName()
          Get the full qualified name of this file.
 long length()
          Get the length of the file.
 void readFully(byte[] b, int off, int len)
          Read from the file.
 void seek(long pos)
          Go to the specified position in the file.
 void setFileLength(long newLength)
          Change the length of the file.
 void sync()
          Force changes to the physical location.
 void write(byte[] b, int off, int len)
          Write to the file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

close

public void close()
           throws java.io.IOException
Description copied from interface: FileObject
Close the file.

Specified by:
close in interface FileObject
Throws:
java.io.IOException

getFilePointer

public long getFilePointer()
Description copied from interface: FileObject
Get the file pointer.

Specified by:
getFilePointer in interface FileObject
Returns:
the current file pointer

getName

public java.lang.String getName()
Description copied from interface: FileObject
Get the full qualified name of this file.

Specified by:
getName in interface FileObject
Returns:
the name

length

public long length()
            throws java.io.IOException
Description copied from interface: FileObject
Get the length of the file.

Specified by:
length in interface FileObject
Returns:
the length
Throws:
java.io.IOException

readFully

public void readFully(byte[] b,
                      int off,
                      int len)
Description copied from interface: FileObject
Read from the file.

Specified by:
readFully in interface FileObject
Parameters:
b - the byte array
off - the offset
len - the number of bytes

seek

public void seek(long pos)
Description copied from interface: FileObject
Go to the specified position in the file.

Specified by:
seek in interface FileObject
Parameters:
pos - the new position

setFileLength

public void setFileLength(long newLength)
                   throws java.io.IOException
Description copied from interface: FileObject
Change the length of the file.

Specified by:
setFileLength in interface FileObject
Parameters:
newLength - the new length
Throws:
java.io.IOException

sync

public void sync()
          throws java.io.IOException
Description copied from interface: FileObject
Force changes to the physical location.

Specified by:
sync in interface FileObject
Throws:
java.io.IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Description copied from interface: FileObject
Write to the file.

Specified by:
write in interface FileObject
Parameters:
b - the byte array
off - the offset
len - the number of bytes
Throws:
java.io.IOException