FreeHEP API
Version current

org.freehep.util.io
Class TaggedInputStream

java.lang.Object
  extended byjava.io.InputStream
      extended byorg.freehep.util.io.DecompressableInputStream
          extended byorg.freehep.util.io.BitInputStream
              extended byorg.freehep.util.io.ByteOrderInputStream
                  extended byorg.freehep.util.io.ByteCountInputStream
                      extended byorg.freehep.util.io.TaggedInputStream
All Implemented Interfaces:
DataInput
Direct Known Subclasses:
CGMInputStream, EMFInputStream, SWFInputStream

public abstract class TaggedInputStream
extends ByteCountInputStream

Class to read Tagged blocks from a Stream. The tagged blocks (Tags) contain a tagID and a Length, so that known and unknown tags can be read and written (using the TaggedOutputStream). The stream also allows to read Actions, which again come with a actionCode and a length. A set of recognized Tags and Actions can be added to this stream. A concrete implementation of this stream should decode/read the TagHeader. All Concrete tags should be inherited from the Tag class and implement their read methods.

Version:
$Id: TaggedInputStream.java,v 1.8 2001/11/20 17:11:54 duns Exp $
Author:
Mark Donszelmann, Charles Loomis
Source Code:
TaggedInputStream.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
 
Fields inherited from class org.freehep.util.io.ByteOrderInputStream
little
 
Fields inherited from class org.freehep.util.io.BitInputStream
BIT_MASK, FIELD_MASK, MASK_SIZE, ONES, ZERO
 
Constructor Summary
TaggedInputStream(InputStream in, TagSet tagSet, ActionSet actionSet)
           
TaggedInputStream(InputStream in, TagSet tagSet, ActionSet actionSet, boolean littleEndian)
           
 
Method Summary
 void addAction(Action action)
           
 void addTag(Tag tag)
           
 Action readAction()
           
protected abstract  ActionHeader readActionHeader()
          Decodes and returns the ActionHeader, which includes an actionCode and a length
 Tag readTag()
          Read a tag.
protected abstract  TagHeader readTagHeader()
          Decodes and returns the TagHeader, which includes a TagID and a length
 
Methods inherited from class org.freehep.util.io.ByteCountInputStream
getLength, popBuffer, pushBuffer, read
 
Methods inherited from class org.freehep.util.io.ByteOrderInputStream
readAsciiZString, readBoolean, readByte, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readInt, readLine, readLong, readShort, readShort, readString, readUnsignedByte, readUnsignedByte, readUnsignedInt, readUnsignedInt, readUnsignedShort, readUnsignedShort, readUTF, skipBytes
 
Methods inherited from class org.freehep.util.io.BitInputStream
byteAlign, fetchByte, readBitFlag, readFBits, readSBits, readUBits
 
Methods inherited from class org.freehep.util.io.DecompressableInputStream
skip, startDecompressing
 
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, read, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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

Constructor Detail

TaggedInputStream

public TaggedInputStream(InputStream in,
                         TagSet tagSet,
                         ActionSet actionSet)

TaggedInputStream

public TaggedInputStream(InputStream in,
                         TagSet tagSet,
                         ActionSet actionSet,
                         boolean littleEndian)
Method Detail

addTag

public void addTag(Tag tag)

readTagHeader

protected abstract TagHeader readTagHeader()
                                    throws IOException
Decodes and returns the TagHeader, which includes a TagID and a length

Throws:
IOException

readTag

public Tag readTag()
            throws IOException
Read a tag.

Throws:
IOException

addAction

public void addAction(Action action)

readActionHeader

protected abstract ActionHeader readActionHeader()
                                          throws IOException
Decodes and returns the ActionHeader, which includes an actionCode and a length

Throws:
IOException

readAction

public Action readAction()
                  throws IOException
Throws:
IOException

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.