org.freehep.util.io
Class TaggedInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.freehep.util.io.DecompressableInputStream
-
- org.freehep.util.io.BitInputStream
-
- org.freehep.util.io.ByteOrderInputStream
-
- org.freehep.util.io.ByteCountInputStream
-
- org.freehep.util.io.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 Summary
Constructors Constructor and Description TaggedInputStream(java.io.InputStream in, TagSet tagSet, ActionSet actionSet)Creates a Tagged Input StreamTaggedInputStream(java.io.InputStream in, TagSet tagSet, ActionSet actionSet, boolean littleEndian)Creates a Tagged Input Stream
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddAction(Action action)Add action to action set.voidaddTag(Tag tag)Add tag to tagsetTagHeadergetTagHeader()Returns the currently valid TagHeader.ActionreadAction()Reads action.TagreadTag()Read a tag.-
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, readBitFlag, readFBits, readSBits, readUBits
-
Methods inherited from class org.freehep.util.io.DecompressableInputStream
skip, startDecompressing
-
-
-
-
Constructor Detail
-
TaggedInputStream
public TaggedInputStream(java.io.InputStream in, TagSet tagSet, ActionSet actionSet)Creates a Tagged Input Stream- Parameters:
in- stream to read fromtagSet- available tag setactionSet- available action set
-
-
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