de.grogra.persistence
Class PersistenceOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by de.grogra.persistence.PersistenceOutputStream
All Implemented Interfaces:
PersistenceOutput, java.io.Closeable, java.io.DataOutput, java.io.Flushable

public class PersistenceOutputStream
extends java.io.OutputStream
implements PersistenceOutput, java.io.DataOutput


Field Summary
static int MAGIC
           
 
Constructor Summary
PersistenceOutputStream(BindingsCache cache, java.io.DataOutputStream out)
           
 
Method Summary
 void beginArray(int length, Type ct)
           
 void beginExtent(PersistenceManager manager)
           
 void beginField(ManageableType.Field field)
           
 void beginFields()
           
 boolean beginManaged(ManageableType type, boolean writeType)
           
 void close()
           
 void endArray()
           
 void endExtent()
           
 void endField(ManageableType.Field field)
           
 void endFields()
           
 void endManaged(java.lang.Object object, boolean writeType)
           
 void flush()
           
 void setNested(boolean nested)
           
 void write(BindingsCache cache)
           
 void write(byte[] v)
           
 void write(byte[] v, int offset, int length)
           
 void write(int v)
           
 void writeBoolean(boolean v)
           
 void writeByte(int v)
           
 void writeBytes(java.lang.String v)
           
 void writeChar(int v)
           
 void writeChars(java.lang.String v)
           
 void writeDouble(double v)
           
 void writeFloat(float v)
           
 void writeInt(int v)
           
 void writeLong(long v)
           
 void writeName(java.lang.String v)
           
 void writeNullObject()
           
 void writeObject(java.lang.Object v, Type type)
           
 void writePersistentObjectReference(PersistenceCapable o)
           
 void writeSharedObjectReference(Shareable o)
           
 void writeShort(int v)
           
 void writeString(java.lang.String v)
           
 void writeStringObject(java.lang.String value)
           
 void writeUTF(java.lang.String v)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAGIC

public static final int MAGIC
See Also:
Constant Field Values
Constructor Detail

PersistenceOutputStream

public PersistenceOutputStream(BindingsCache cache,
                               java.io.DataOutputStream out)
                        throws java.io.IOException
Throws:
java.io.IOException
Method Detail

beginArray

public void beginArray(int length,
                       Type ct)
                throws java.io.IOException
Specified by:
beginArray in interface PersistenceOutput
Throws:
java.io.IOException

beginExtent

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

beginField

public void beginField(ManageableType.Field field)
                throws java.io.IOException
Specified by:
beginField in interface PersistenceOutput
Throws:
java.io.IOException

beginFields

public void beginFields()
Specified by:
beginFields in interface PersistenceOutput

beginManaged

public boolean beginManaged(ManageableType type,
                            boolean writeType)
                     throws java.io.IOException
Specified by:
beginManaged in interface PersistenceOutput
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.OutputStream
Throws:
java.io.IOException

endArray

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

endExtent

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

endField

public void endField(ManageableType.Field field)
Specified by:
endField in interface PersistenceOutput

endFields

public void endFields()
               throws java.io.IOException
Specified by:
endFields in interface PersistenceOutput
Throws:
java.io.IOException

endManaged

public void endManaged(java.lang.Object object,
                       boolean writeType)
Specified by:
endManaged in interface PersistenceOutput

flush

public void flush()
           throws java.io.IOException
Specified by:
flush in interface java.io.Flushable
Overrides:
flush in class java.io.OutputStream
Throws:
java.io.IOException

setNested

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

write

public void write(BindingsCache cache)
           throws java.io.IOException
Throws:
java.io.IOException

write

public void write(byte[] v)
           throws java.io.IOException
Specified by:
write in interface java.io.DataOutput
Overrides:
write in class java.io.OutputStream
Throws:
java.io.IOException

write

public void write(byte[] v,
                  int offset,
                  int length)
           throws java.io.IOException
Specified by:
write in interface java.io.DataOutput
Overrides:
write in class java.io.OutputStream
Throws:
java.io.IOException

write

public void write(int v)
           throws java.io.IOException
Specified by:
write in interface java.io.DataOutput
Specified by:
write in class java.io.OutputStream
Throws:
java.io.IOException

writeBoolean

public void writeBoolean(boolean v)
                  throws java.io.IOException
Specified by:
writeBoolean in interface PersistenceOutput
Specified by:
writeBoolean in interface java.io.DataOutput
Throws:
java.io.IOException

writeByte

public void writeByte(int v)
               throws java.io.IOException
Specified by:
writeByte in interface PersistenceOutput
Specified by:
writeByte in interface java.io.DataOutput
Throws:
java.io.IOException

writeBytes

public void writeBytes(java.lang.String v)
                throws java.io.IOException
Specified by:
writeBytes in interface java.io.DataOutput
Throws:
java.io.IOException

writeChar

public void writeChar(int v)
               throws java.io.IOException
Specified by:
writeChar in interface PersistenceOutput
Specified by:
writeChar in interface java.io.DataOutput
Throws:
java.io.IOException

writeChars

public void writeChars(java.lang.String v)
                throws java.io.IOException
Specified by:
writeChars in interface java.io.DataOutput
Throws:
java.io.IOException

writeDouble

public void writeDouble(double v)
                 throws java.io.IOException
Specified by:
writeDouble in interface PersistenceOutput
Specified by:
writeDouble in interface java.io.DataOutput
Throws:
java.io.IOException

writeFloat

public void writeFloat(float v)
                throws java.io.IOException
Specified by:
writeFloat in interface PersistenceOutput
Specified by:
writeFloat in interface java.io.DataOutput
Throws:
java.io.IOException

writeInt

public void writeInt(int v)
              throws java.io.IOException
Specified by:
writeInt in interface PersistenceOutput
Specified by:
writeInt in interface java.io.DataOutput
Throws:
java.io.IOException

writeLong

public void writeLong(long v)
               throws java.io.IOException
Specified by:
writeLong in interface PersistenceOutput
Specified by:
writeLong in interface java.io.DataOutput
Throws:
java.io.IOException

writeName

public void writeName(java.lang.String v)
               throws java.io.IOException
Specified by:
writeName in interface PersistenceOutput
Throws:
java.io.IOException

writeNullObject

public void writeNullObject()
                     throws java.io.IOException
Specified by:
writeNullObject in interface PersistenceOutput
Throws:
java.io.IOException

writeObject

public void writeObject(java.lang.Object v,
                        Type type)
                 throws java.io.IOException
Specified by:
writeObject in interface PersistenceOutput
Throws:
java.io.IOException

writePersistentObjectReference

public void writePersistentObjectReference(PersistenceCapable o)
                                    throws java.io.IOException
Specified by:
writePersistentObjectReference in interface PersistenceOutput
Throws:
java.io.IOException

writeSharedObjectReference

public void writeSharedObjectReference(Shareable o)
                                throws java.io.IOException
Specified by:
writeSharedObjectReference in interface PersistenceOutput
Throws:
java.io.IOException

writeShort

public void writeShort(int v)
                throws java.io.IOException
Specified by:
writeShort in interface PersistenceOutput
Specified by:
writeShort in interface java.io.DataOutput
Throws:
java.io.IOException

writeString

public void writeString(java.lang.String v)
                 throws java.io.IOException
Specified by:
writeString in interface PersistenceOutput
Throws:
java.io.IOException

writeStringObject

public void writeStringObject(java.lang.String value)
                       throws java.io.IOException
Specified by:
writeStringObject in interface PersistenceOutput
Throws:
java.io.IOException

writeUTF

public void writeUTF(java.lang.String v)
              throws java.io.IOException
Specified by:
writeUTF in interface java.io.DataOutput
Throws:
java.io.IOException