|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.OutputStream java.io.FilterOutputStream java.io.DataOutputStream com.hdcookbook.grin.io.binary.GrinDataOutputStream
public class GrinDataOutputStream
GrinDataOutputStream is a convenience DataOutputStream subclass that knows how to write out certain Objects and Object arrays, including null. This class is used by the GrinBinaryWriter to write out information about show nodes.
GrinBinaryWriter
,
GrinDataInputStream
Field Summary |
---|
Fields inherited from class java.io.DataOutputStream |
---|
written |
Fields inherited from class java.io.FilterOutputStream |
---|
out |
Method Summary | |
---|---|
void |
writeColor(java.awt.Color color)
Writes out a Color instance. |
void |
writeCommands(Command[] commands)
Writes out the reference to an array of references to the given commands. |
void |
writeFeatureReference(Feature feature)
Writes out a reference of a Feature. |
void |
writeFeaturesArrayReference(Feature[] features)
Reads in refereces of Features and returns an array of Features corresponding to the references. |
void |
writeIntArray(int[] array)
Writes out an array of integers. |
void |
writeNonNull()
Writes out an indication to the binary file that the object is not null. |
void |
writeNull()
Writes out an indication to the binary file that the object is null. |
void |
writeRCHandlerReference(RCHandler handler)
Writes out a reference of an RCHandler. |
void |
writeRCHandlersArrayReference(RCHandler[] handlers)
Writes out refereces of RCHandler in the array. |
void |
writeRectangle(java.awt.Rectangle rect)
Writes out a Rectangle instance. |
void |
writeRectangleArray(java.awt.Rectangle[] array)
Writes out an array of Rectangles. |
void |
writeSegmentReference(Segment segment)
Writes out a reference of a segment. |
void |
writeSharedIntArray(int[] array)
|
void |
writeSharedRectangle(java.awt.Rectangle r)
|
void |
writeSharedRectangleArray(java.awt.Rectangle[] r)
|
void |
writeString(java.lang.String string)
Writes out a reference to a String instance. |
void |
writeStringArray(java.lang.String[] array)
Writes out an array of Strings. |
void |
writeSuperClassData(Command command)
Writes out information common to all Command types. |
void |
writeSuperClassData(Feature feature)
Writes out information common to all Feature types. |
void |
writeSuperClassData(RCHandler handler)
Writes out information common to all RCHandler types. |
void |
writeSuperClassData(Segment segment)
Writes out information common to all Segment types. |
Methods inherited from class java.io.DataOutputStream |
---|
flush, size, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF |
Methods inherited from class java.io.FilterOutputStream |
---|
close, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.io.DataOutput |
---|
write |
Method Detail |
---|
public void writeColor(java.awt.Color color) throws java.io.IOException
color
- The color instance to write out.
java.io.IOException
- if IO error occurs.public void writeRectangle(java.awt.Rectangle rect) throws java.io.IOException
rect
- The rectangle to write out.
java.io.IOException
- if IO error occurs.public void writeRectangleArray(java.awt.Rectangle[] array) throws java.io.IOException
array
- An array of rectangles to write out.
java.io.IOException
- if IO error occurs.public void writeIntArray(int[] array) throws java.io.IOException
array
- An array of integers to write out.
java.io.IOException
- if IO error occurs.public void writeSharedIntArray(int[] array) throws java.io.IOException
java.io.IOException
public void writeSharedRectangle(java.awt.Rectangle r) throws java.io.IOException
java.io.IOException
public void writeSharedRectangleArray(java.awt.Rectangle[] r) throws java.io.IOException
java.io.IOException
public void writeString(java.lang.String string) throws java.io.IOException
string
- The String to write out.
java.io.IOException
- if IO error occurs.public void writeStringArray(java.lang.String[] array) throws java.io.IOException
array
- An array of Strings to write out.
java.io.IOException
- if IO error occurs.public void writeFeatureReference(Feature feature) throws java.io.IOException
feature
- The feature to write out.
java.io.IOException
- if IO error occurs, or
if no such feature exists in the show that
this GrinDataInputStream is working with.public void writeSegmentReference(Segment segment) throws java.io.IOException
segment
- The segment to write out.
java.io.IOException
- if IO error occurs, or
if no such feature exists in the show that
this GrinDataInputStream is working with.public void writeRCHandlerReference(RCHandler handler) throws java.io.IOException
handler
- The RCHandler to write out.
java.io.IOException
- if IO error occurs, or
if no such RCHandler exists in the show that
this GrinDataInputStream is working with.public void writeFeaturesArrayReference(Feature[] features) throws java.io.IOException
java.io.IOException
public void writeRCHandlersArrayReference(RCHandler[] handlers) throws java.io.IOException
java.io.IOException
public void writeCommands(Command[] commands) throws java.io.IOException
commands
- An array of commands to write out to.
java.io.IOException
public void writeNull() throws java.io.IOException
public void writeInstanceData(GrinDataOutputStream out) { .... if (myObject == null) { out.writeNull(); } else { out.writeNonNull(); ... write "myObject" content to "out" ... } ... }Note that such null check is already done for all the convenience methods provided in this class, such as writeString(String), writeRectangle(Rect), writeColor(Color) etc.
java.io.IOException
writeNonNull()
,
GrinDataInputStream.isNull()
public void writeNonNull() throws java.io.IOException
java.io.IOException
writeNull()
,
GrinDataInputStream.isNull()
public void writeSuperClassData(Feature feature) throws java.io.IOException
feature
- Feature instance to write out.
java.io.IOException
GrinDataInputStream.readSuperClassData(Feature)
public void writeSuperClassData(RCHandler handler) throws java.io.IOException
handler
- RCHandler instance to write out.
java.io.IOException
GrinDataInputStream.readSuperClassData(RCHandler)
public void writeSuperClassData(Segment segment) throws java.io.IOException
segment
- Segment instance to write out.
java.io.IOException
GrinDataInputStream.readSuperClassData(Segment)
public void writeSuperClassData(Command command)
command
- Command instance to write out.
java.io.IOException
GrinDataInputStream.readSuperClassData(Command)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |