ewe.database
Class DatabaseObject.MetaData

java.lang.Object
  extended byewe.util.Errorable
      extended byewe.io.BasicStreamObject
          extended byewe.io.BlockingStreamObject
              extended byewe.database.DatabaseObject.MetaData
All Implemented Interfaces:
BasicStream, Stream, Streamable
Enclosing class:
DatabaseObject

protected abstract class DatabaseObject.MetaData
extends BlockingStreamObject


Field Summary
 int numberOfFragments
          This is only valid after a read operation.
 
Fields inherited from class ewe.io.BasicStreamObject
closed
 
Fields inherited from class ewe.util.Errorable
error
 
Constructor Summary
protected DatabaseObject.MetaData(String name)
           
 
Method Summary
abstract  boolean delete()
           
 byte[] openAndReadAll()
           
 ByteArray openAndReadAll(ByteArray ba)
           
abstract  boolean openForAppending(boolean mustExist)
           
abstract  void openForOverwriting(int bytesNeededToWrite)
           
abstract  int openForReading()
           
abstract  void openForReplacing(int bytesNeededToWrite)
           
abstract  int read(byte[] data, int offset, int length)
          Reads bytes into a buffer.
 void readAll(byte[] data, int offset, int length)
           
abstract  long size()
           
abstract  void write(byte[] data, int offset, int length)
          Writes bytes from a buffer to the Stream.
 
Methods inherited from class ewe.io.BlockingStreamObject
close, closeStream, flush, flushStream, isOpen, nonBlockingRead, nonBlockingWrite, readBytes, readBytes, writeBytes, writeBytes
 
Methods inherited from class ewe.io.BasicStreamObject
getException, getName, read, read, throwIOException, toInputStream, toOutputStream, toStream, write, write
 
Methods inherited from class ewe.util.Errorable
returnError, returnError, returnError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, toString
 

Field Detail

numberOfFragments

public int numberOfFragments
This is only valid after a read operation.

Constructor Detail

DatabaseObject.MetaData

protected DatabaseObject.MetaData(String name)
Method Detail

openForReplacing

public abstract void openForReplacing(int bytesNeededToWrite)
                               throws IOException
Throws:
IOException

openForAppending

public abstract boolean openForAppending(boolean mustExist)
                                  throws IOException
Throws:
IOException

openForOverwriting

public abstract void openForOverwriting(int bytesNeededToWrite)
                                 throws IOException
Throws:
IOException

openForReading

public abstract int openForReading()
                            throws IOException
Throws:
IOException

write

public abstract void write(byte[] data,
                           int offset,
                           int length)
                    throws IOException
Description copied from interface: Stream
Writes bytes from a buffer to the Stream. This method blocks the current Coroutine until all bytes are written, but allows others to continue executing.

Specified by:
write in interface Stream
Overrides:
write in class BlockingStreamObject
Throws:
IOException

read

public abstract int read(byte[] data,
                         int offset,
                         int length)
                  throws IOException
Description copied from interface: Stream
Reads bytes into a buffer. This method blocks the current Coroutine, but allows others to continue executing.

Specified by:
read in interface Stream
Overrides:
read in class BlockingStreamObject
Throws:
IOException

size

public abstract long size()
                   throws IOException
Throws:
IOException

delete

public abstract boolean delete()
                        throws IOException
Throws:
IOException

readAll

public void readAll(byte[] data,
                    int offset,
                    int length)
             throws IOException
Throws:
IOException

openAndReadAll

public ByteArray openAndReadAll(ByteArray ba)
                         throws IOException
Throws:
IOException

openAndReadAll

public byte[] openAndReadAll()
                      throws IOException
Throws:
IOException