FreeHEP API
Version current

org.freehep.graphicsio.cgm
Class CGMOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended byjava.io.FilterOutputStream
          extended byorg.freehep.util.io.CompressableOutputStream
              extended byorg.freehep.util.io.BitOutputStream
                  extended byorg.freehep.util.io.ByteOrderOutputStream
                      extended byorg.freehep.util.io.ByteCountOutputStream
                          extended byorg.freehep.util.io.TaggedOutputStream
                              extended byorg.freehep.graphicsio.cgm.CGMOutputStream
All Implemented Interfaces:
DataOutput, FinishableOutputStream, TaggedOutput

public class CGMOutputStream
extends TaggedOutputStream

CGM Binary Output Stream. Tags written with this OutputStream will produce a binary CGM file. The class also holds the state for the various precisions, defaults, etc...

Version:
$Id: CGMOutputStream.java,v 1.5 2003/11/26 17:39:40 duns Exp $
Author:
Mark Donszelmann, Charles Loomis, Ian Graham - support for long commands through partitioning
Source Code:
CGMOutputStream.java

Field Summary
 
Fields inherited from class org.freehep.util.io.TaggedOutputStream
actionSet, tagSet
 
Fields inherited from class org.freehep.util.io.ByteOrderOutputStream
little, written
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
CGMOutputStream(OutputStream os)
           
CGMOutputStream(OutputStream os, int version)
           
 
Method Summary
 int getVersion()
           
protected  void writeActionHeader(ActionHeader header)
          Writes the ActionHeader, which includes an actionCode and a length
 void writeColor(Color c)
           
 void writeColorComponent(int c)
           
 void writeColorDirect(Color c)
           
 void writeColorIndex(int i)
           
 void writeData(byte[] data)
           
 void writeEnumerate(int i)
           
 void writeFixedPoint(double d)
           
 void writeFloatingPoint(double d)
           
 void writeInteger(int i)
           
 void writeIntegerIndex(int i)
           
 void writeName(int name)
           
 void writePoint(Point2D p)
           
 void writeReal(double r)
           
 void writeString(String s)
           
 void writeTag(Tag tag)
          Write a tag.
protected  void writeTagHeader(TagHeader header)
          Writes the TagHeader, which includes a TagID and a length
 void writeVDC(double d)
           
 
Methods inherited from class org.freehep.util.io.TaggedOutputStream
getTagAlignment, writeAction
 
Methods inherited from class org.freehep.util.io.ByteCountOutputStream
append, close, getBufferLength, getLength, popBuffer, popBufferBytes, pushBuffer, write
 
Methods inherited from class org.freehep.util.io.ByteOrderOutputStream
size, writeAsciiZString, writeBoolean, writeByte, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeInt, writeLong, writeShort, writeShort, writeUnsignedByte, writeUnsignedByte, writeUnsignedInt, writeUnsignedInt, writeUnsignedShort, writeUnsignedShort, writeUTF, writeUTF
 
Methods inherited from class org.freehep.util.io.BitOutputStream
byteAlign, finish, flushByte, minBits, minBits, minBits, writeBitFlag, writeFBits, writeSBits, writeUBits
 
Methods inherited from class org.freehep.util.io.CompressableOutputStream
startCompressing, write
 
Methods inherited from class java.io.FilterOutputStream
flush, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.freehep.util.io.TaggedOutput
close
 
Methods inherited from interface java.io.DataOutput
write, write
 

Constructor Detail

CGMOutputStream

public CGMOutputStream(OutputStream os,
                       int version)
                throws IOException

CGMOutputStream

public CGMOutputStream(OutputStream os)
                throws IOException
Method Detail

writeFixedPoint

public void writeFixedPoint(double d)
                     throws IOException
Throws:
IOException

writeFloatingPoint

public void writeFloatingPoint(double d)
                        throws IOException
Throws:
IOException

writeColorIndex

public void writeColorIndex(int i)
                     throws IOException
Throws:
IOException

writeColorComponent

public void writeColorComponent(int c)
                         throws IOException
Throws:
IOException

writeColorDirect

public void writeColorDirect(Color c)
                      throws IOException
Throws:
IOException

writeIntegerIndex

public void writeIntegerIndex(int i)
                       throws IOException
Throws:
IOException

writeEnumerate

public void writeEnumerate(int i)
                    throws IOException
Throws:
IOException

writeInteger

public void writeInteger(int i)
                  throws IOException
Throws:
IOException

writeReal

public void writeReal(double r)
               throws IOException
Throws:
IOException

writeString

public void writeString(String s)
                 throws IOException
Overrides:
writeString in class ByteOrderOutputStream
Throws:
IOException

writeData

public void writeData(byte[] data)
               throws IOException
Throws:
IOException

writeVDC

public void writeVDC(double d)
              throws IOException
Throws:
IOException

writePoint

public void writePoint(Point2D p)
                throws IOException
Throws:
IOException

writeColor

public void writeColor(Color c)
                throws IOException
Throws:
IOException

writeName

public void writeName(int name)
               throws IOException
Throws:
IOException

writeTagHeader

protected void writeTagHeader(TagHeader header)
                       throws IOException
Description copied from class: TaggedOutputStream
Writes the TagHeader, which includes a TagID and a length

Specified by:
writeTagHeader in class TaggedOutputStream
Throws:
IOException

writeTag

public void writeTag(Tag tag)
              throws IOException
Description copied from class: TaggedOutputStream
Write a tag.

Specified by:
writeTag in interface TaggedOutput
Overrides:
writeTag in class TaggedOutputStream
Throws:
IOException

writeActionHeader

protected void writeActionHeader(ActionHeader header)
                          throws IOException
Description copied from class: TaggedOutputStream
Writes the ActionHeader, which includes an actionCode and a length

Specified by:
writeActionHeader in class TaggedOutputStream
Throws:
IOException

getVersion

public int getVersion()

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.