Documentation of 'org.freehep.util.io.TaggedInputStream' Java class
TaggedInputStream
org.freehep.util.io

Class TaggedInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.io.DataInput, java.lang.AutoCloseable


    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.
    • Constructor Detail

      • TaggedInputStream

        public TaggedInputStream(java.io.InputStream in,
                                 TagSet tagSet,
                                 ActionSet actionSet)
        Creates a Tagged Input Stream
        Parameters:
        in - stream to read from
        tagSet - available tag set
        actionSet - available action set
      • TaggedInputStream

        public TaggedInputStream(java.io.InputStream in,
                                 TagSet tagSet,
                                 ActionSet actionSet,
                                 boolean littleEndian)
        Creates a Tagged Input Stream
        Parameters:
        in - stream to read from
        tagSet - available tag set
        actionSet - available action set
        littleEndian - true if stream is little endian
    • Method Detail

      • addTag

        public void addTag(Tag tag)
        Add tag to tagset
        Parameters:
        tag - new tag
      • readTag

        public Tag readTag()
                    throws java.io.IOException
        Read a tag.
        Returns:
        read tag
        Throws:
        java.io.IOException - if read fails
      • getTagHeader

        public TagHeader getTagHeader()
        Returns the currently valid TagHeader. Can be called durring the tag.read() method.
      • addAction

        public void addAction(Action action)
        Add action to action set.
        Parameters:
        action - new action
      • readAction

        public Action readAction()
                          throws java.io.IOException
        Reads action.
        Returns:
        read action
        Throws:
        java.io.IOException - if read fails

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.