de.grogra.persistence
Class PersistenceInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by de.grogra.persistence.PersistenceInputStream
All Implemented Interfaces:
PersistenceInput, java.io.Closeable, java.io.DataInput

public class PersistenceInputStream
extends java.io.FilterInputStream
implements PersistenceInput, java.io.DataInput


Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Fields inherited from interface de.grogra.persistence.PersistenceInput
ARRAY_OBJECT, MANAGEABLE_OBJECT, MIN_UNUSED_KIND, NULL_OBJECT, PERSISTENT_OBJECT_ID, PLAIN_OBJECT, SERIALIZED_OBJECT, SHARED_OBJECT_REFERENCE, STRING_OBJECT
 
Constructor Summary
PersistenceInputStream(PersistenceBindings bindings, java.io.DataInputStream in)
           
 
Method Summary
 boolean areFieldsProvided()
           
 int beginArray()
           
 boolean beginComponent(ManageableType.ArrayComponent c, int index)
           
 void beginExtent(PersistenceManager manager)
           
 ManageableType.Field beginField(ManageableType type, ManageableType.Field field)
           
 ManageableType beginManaged()
           
 void check(int expected)
           
 void checkInt(int expected)
           
 void endArray()
           
 void endComponent()
           
 void endExtent()
           
 void endField()
           
 void endManaged()
           
 PersistenceBindings getBindings()
           
 BindingsCache getCache(short cacheId)
           
 int getNextObjectKind()
           
 boolean markSupported()
           
 boolean readBoolean()
           
 byte readByte()
           
 BindingsCache readCache()
           
 char readChar()
           
 double readDouble()
           
 float readFloat()
           
 void readFully(byte[] b)
           
 void readFully(byte[] b, int off, int len)
           
 int readInt()
           
 java.lang.String readLine()
           
 long readLong()
           
 java.lang.String readName()
           
 java.lang.Object readObject(int kind, Type type)
           
 PersistenceCapable readPersistentObject()
           
 long readPersistentObjectId()
           
 Shareable readSharedObject()
           
 short readShort()
           
 java.lang.String readString()
           
 int readUnsignedByte()
           
 int readUnsignedShort()
           
 java.lang.String readUTF()
           
 void reset()
           
 PersistenceCapable resolveId(long inputId)
           
 void setNested(boolean nested)
           
 int skipBytes(int n)
           
 
Methods inherited from class java.io.FilterInputStream
available, close, mark, read, read, read, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistenceInputStream

public PersistenceInputStream(PersistenceBindings bindings,
                              java.io.DataInputStream in)
                       throws java.io.IOException
Throws:
java.io.IOException
Method Detail

areFieldsProvided

public boolean areFieldsProvided()
Specified by:
areFieldsProvided in interface PersistenceInput

beginArray

public int beginArray()
               throws java.io.IOException
Specified by:
beginArray in interface PersistenceInput
Throws:
java.io.IOException

beginComponent

public boolean beginComponent(ManageableType.ArrayComponent c,
                              int index)
Specified by:
beginComponent in interface PersistenceInput

beginExtent

public void beginExtent(PersistenceManager manager)
                 throws java.io.IOException
Throws:
java.io.IOException

beginField

public ManageableType.Field beginField(ManageableType type,
                                       ManageableType.Field field)
                                throws java.io.IOException
Specified by:
beginField in interface PersistenceInput
Throws:
java.io.IOException

beginManaged

public ManageableType beginManaged()
                            throws java.io.IOException
Specified by:
beginManaged in interface PersistenceInput
Throws:
java.io.IOException

check

public final void check(int expected)
                 throws java.io.IOException
Throws:
java.io.IOException

checkInt

public final void checkInt(int expected)
                    throws java.io.IOException
Throws:
java.io.IOException

endArray

public void endArray()
Specified by:
endArray in interface PersistenceInput

endComponent

public void endComponent()
Specified by:
endComponent in interface PersistenceInput

endExtent

public void endExtent()
               throws java.io.IOException
Throws:
java.io.IOException

endField

public void endField()
Specified by:
endField in interface PersistenceInput

endManaged

public void endManaged()
Specified by:
endManaged in interface PersistenceInput

getBindings

public PersistenceBindings getBindings()
Specified by:
getBindings in interface PersistenceInput

getCache

public BindingsCache getCache(short cacheId)
                       throws java.io.IOException
Throws:
java.io.IOException

getNextObjectKind

public int getNextObjectKind()
                      throws java.io.IOException
Specified by:
getNextObjectKind in interface PersistenceInput
Throws:
java.io.IOException

markSupported

public final boolean markSupported()
Overrides:
markSupported in class java.io.FilterInputStream

readBoolean

public boolean readBoolean()
                    throws java.io.IOException
Specified by:
readBoolean in interface PersistenceInput
Specified by:
readBoolean in interface java.io.DataInput
Throws:
java.io.IOException

readByte

public byte readByte()
              throws java.io.IOException
Specified by:
readByte in interface PersistenceInput
Specified by:
readByte in interface java.io.DataInput
Throws:
java.io.IOException

readCache

public BindingsCache readCache()
                        throws java.io.IOException
Throws:
java.io.IOException

readChar

public char readChar()
              throws java.io.IOException
Specified by:
readChar in interface PersistenceInput
Specified by:
readChar in interface java.io.DataInput
Throws:
java.io.IOException

readDouble

public double readDouble()
                  throws java.io.IOException
Specified by:
readDouble in interface PersistenceInput
Specified by:
readDouble in interface java.io.DataInput
Throws:
java.io.IOException

readFloat

public float readFloat()
                throws java.io.IOException
Specified by:
readFloat in interface PersistenceInput
Specified by:
readFloat in interface java.io.DataInput
Throws:
java.io.IOException

readFully

public void readFully(byte[] b)
               throws java.io.IOException
Specified by:
readFully in interface java.io.DataInput
Throws:
java.io.IOException

readFully

public void readFully(byte[] b,
                      int off,
                      int len)
               throws java.io.IOException
Specified by:
readFully in interface java.io.DataInput
Throws:
java.io.IOException

readInt

public int readInt()
            throws java.io.IOException
Specified by:
readInt in interface PersistenceInput
Specified by:
readInt in interface java.io.DataInput
Throws:
java.io.IOException

readLine

public java.lang.String readLine()
                          throws java.io.IOException
Specified by:
readLine in interface java.io.DataInput
Throws:
java.io.IOException

readLong

public long readLong()
              throws java.io.IOException
Specified by:
readLong in interface PersistenceInput
Specified by:
readLong in interface java.io.DataInput
Throws:
java.io.IOException

readName

public java.lang.String readName()
                          throws java.io.IOException
Specified by:
readName in interface PersistenceInput
Throws:
java.io.IOException

readObject

public java.lang.Object readObject(int kind,
                                   Type type)
                            throws java.io.IOException
Specified by:
readObject in interface PersistenceInput
Throws:
java.io.IOException

readPersistentObject

public PersistenceCapable readPersistentObject()
                                        throws java.io.IOException
Specified by:
readPersistentObject in interface PersistenceInput
Throws:
java.io.IOException

readPersistentObjectId

public long readPersistentObjectId()
                            throws java.io.IOException
Specified by:
readPersistentObjectId in interface PersistenceInput
Throws:
java.io.IOException

readSharedObject

public Shareable readSharedObject()
                           throws java.io.IOException
Specified by:
readSharedObject in interface PersistenceInput
Throws:
java.io.IOException

readShort

public short readShort()
                throws java.io.IOException
Specified by:
readShort in interface PersistenceInput
Specified by:
readShort in interface java.io.DataInput
Throws:
java.io.IOException

readString

public java.lang.String readString()
                            throws java.io.IOException
Specified by:
readString in interface PersistenceInput
Throws:
java.io.IOException

readUnsignedByte

public int readUnsignedByte()
                     throws java.io.IOException
Specified by:
readUnsignedByte in interface PersistenceInput
Specified by:
readUnsignedByte in interface java.io.DataInput
Throws:
java.io.IOException

readUnsignedShort

public int readUnsignedShort()
                      throws java.io.IOException
Specified by:
readUnsignedShort in interface PersistenceInput
Specified by:
readUnsignedShort in interface java.io.DataInput
Throws:
java.io.IOException

readUTF

public java.lang.String readUTF()
                         throws java.io.IOException
Specified by:
readUTF in interface java.io.DataInput
Throws:
java.io.IOException

reset

public final void reset()
                 throws java.io.IOException
Overrides:
reset in class java.io.FilterInputStream
Throws:
java.io.IOException

resolveId

public PersistenceCapable resolveId(long inputId)
Specified by:
resolveId in interface PersistenceInput

setNested

public void setNested(boolean nested)
Specified by:
setNested in interface PersistenceInput

skipBytes

public int skipBytes(int n)
              throws java.io.IOException
Specified by:
skipBytes in interface java.io.DataInput
Throws:
java.io.IOException