walker
Class FileManipulator

java.lang.Object
  extended by walker.FileManipulator

public class FileManipulator
extends java.lang.Object

Created by IntelliJ IDEA. User: andy Date: Mar 23, 2010 DEPRECATED! A singleton class responsible for splitting the wiseml file and mapping each subfile to virtual memory.


Field Summary
static long SUB_FILE_SIZE
           
 
Method Summary
 ByteBufferBackedInputStream getBBBInputStream(int index)
          Returns a byte buffer containing the requested subfile.
 java.util.zip.GZIPInputStream getGZIPBBBInputStream(int index)
           
static FileManipulator getInstance()
          Returns an instance of this class.
 long getLength()
           
 int getPageNumber()
           
 void readFile()
          Reads a wiseml file and splits it to pageNumber number of mapped byte buffers.
 void readPartFile(long startPosition, long endPosition)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUB_FILE_SIZE

public static final long SUB_FILE_SIZE
See Also:
Constant Field Values
Method Detail

getBBBInputStream

public ByteBufferBackedInputStream getBBBInputStream(int index)
Returns a byte buffer containing the requested subfile. The ByteBufferBackedInputStream can be used as an InputStream.

Parameters:
index - the number of the requested subfile.
Returns:
a byte buffer containing the requested subfile.

getGZIPBBBInputStream

public java.util.zip.GZIPInputStream getGZIPBBBInputStream(int index)
                                                    throws java.io.IOException
Throws:
java.io.IOException

getInstance

public static FileManipulator getInstance()
Returns an instance of this class. If the class has not yet been instantiated, it instantiates it first.

Returns:
the FileManipulator instance.

getLength

public long getLength()
Returns:
the length of the wiseml file

getPageNumber

public int getPageNumber()
Returns:
the total number of subfiles;

readFile

public void readFile()
              throws java.io.IOException
Reads a wiseml file and splits it to pageNumber number of mapped byte buffers.

Throws:
java.io.IOException - is thrown in case of io problems

readPartFile

public void readPartFile(long startPosition,
                         long endPosition)
                  throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException