org.h2.store.fs
Class FileObjectMemory

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

public class FileObjectMemory
extends java.lang.Object
implements FileObject

This class represents an in-memory file.


Method Summary
 void close()
          Close the file.
 long getFilePointer()
          Get the file pointer.
 long getLastModified()
           
 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 newPos)
          Go to the specified position in the file.
 void setFileLength(long newLength)
          Change the length of the file.
 void setName(java.lang.String name)
           
 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

length

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

Specified by:
length in interface FileObject
Returns:
the length

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

seek

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

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

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

readFully

public void readFully(byte[] b,
                      int off,
                      int len)
               throws java.io.IOException
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
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

close

public void close()
Description copied from interface: FileObject
Close the file.

Specified by:
close in interface FileObject

sync

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

Specified by:
sync in interface FileObject

setName

public void setName(java.lang.String name)

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

getLastModified

public long getLastModified()