org.freehep.util.io
Class TaggedOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
org.freehep.util.io.CompressableOutputStream
org.freehep.util.io.BitOutputStream
org.freehep.util.io.ByteOrderOutputStream
org.freehep.util.io.ByteCountOutputStream
org.freehep.util.io.TaggedOutputStream
- All Implemented Interfaces:
- DataOutput, FinishableOutputStream, TaggedOutput
- Direct Known Subclasses:
- CGMOutputStream, EMFOutputStream, SWFOutputStream
- public abstract class TaggedOutputStream
- extends ByteCountOutputStream
- implements TaggedOutput
Class to write Tagged blocks to a Stream. The tagged blocks (Tags) contain
a tagID and a Length, so that known and unknown tags (read with the
TaggedInputStream) can again be written.
The stream also allows to write Actions, which again come with a actionCode and
a length.
A concrete implementation of this stream should encode/write the TagHeader.
All Concrete tags should be inherited from the Tag class and implement
their write methods.
- Version:
- $Id: TaggedOutputStream.java,v 1.11 2003/05/05 00:35:33 duns Exp $
- Author:
- Mark Donszelmann, Charles Loomis
- Source Code:
- TaggedOutputStream.java
Field Summary |
protected ActionSet |
actionSet
Set of actions that can be used by this Stream |
protected TagSet |
tagSet
Set of tags that can be used by this Stream |
Methods inherited from class org.freehep.util.io.ByteOrderOutputStream |
size, writeAsciiZString, writeBoolean, writeByte, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeInt, writeLong, writeShort, writeShort, writeString, writeUnsignedByte, writeUnsignedByte, writeUnsignedInt, writeUnsignedInt, writeUnsignedShort, writeUnsignedShort, writeUTF, writeUTF |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
tagSet
protected TagSet tagSet
- Set of tags that can be used by this Stream
actionSet
protected ActionSet actionSet
- Set of actions that can be used by this Stream
TaggedOutputStream
public TaggedOutputStream(OutputStream out,
TagSet tagSet,
ActionSet actionSet)
TaggedOutputStream
public TaggedOutputStream(OutputStream out,
TagSet tagSet,
ActionSet actionSet,
boolean littleEndian)
writeTagHeader
protected abstract void writeTagHeader(TagHeader header)
throws IOException
- Writes the TagHeader, which includes a TagID and a length
- Throws:
IOException
getTagAlignment
protected int getTagAlignment()
- Specifies tag alignment
1 byte
2 short
4 int
8 long
writeTag
public void writeTag(Tag tag)
throws IOException
- Write a tag.
- Specified by:
writeTag
in interface TaggedOutput
- Throws:
IOException
writeActionHeader
protected abstract void writeActionHeader(ActionHeader header)
throws IOException
- Writes the ActionHeader, which includes an actionCode and a length
- Throws:
IOException
writeAction
public void writeAction(Action action)
throws IOException
- Throws:
IOException
Copyright © 2000-2004 FreeHEP, All Rights Reserved.