|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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
public abstract class TaggedInputStream
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.
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)
Creates a Tagged Input Stream |
|
TaggedInputStream(InputStream in,
TagSet tagSet,
ActionSet actionSet,
boolean littleEndian)
Creates a Tagged Input Stream |
Method Summary | |
---|---|
void |
addAction(Action action)
Add action to action set. |
void |
addTag(Tag tag)
Add tag to tagset |
TagHeader |
getTagHeader()
Returns the currently valid TagHeader. |
Action |
readAction()
Reads action. |
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 |
---|
protected TagSet tagSet
protected ActionSet actionSet
Constructor Detail |
---|
public TaggedInputStream(InputStream in, TagSet tagSet, ActionSet actionSet)
in
- stream to read fromtagSet
- available tag setactionSet
- available action setpublic TaggedInputStream(InputStream in, TagSet tagSet, ActionSet actionSet, boolean littleEndian)
in
- stream to read fromtagSet
- available tag setactionSet
- available action setlittleEndian
- true if stream is little endianMethod Detail |
---|
public void addTag(Tag tag)
tag
- new tagprotected abstract TagHeader readTagHeader() throws IOException
IOException
- if read failspublic Tag readTag() throws IOException
IOException
- if read failspublic TagHeader getTagHeader()
public void addAction(Action action)
action
- new actionprotected abstract ActionHeader readActionHeader() throws IOException
IOException
- if read failspublic Action readAction() throws IOException
IOException
- if read fails
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |