|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.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
public abstract class TaggedOutputStream
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.
| 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.ByteOrderOutputStream |
|---|
little, written |
| Fields inherited from class java.io.FilterOutputStream |
|---|
out |
| Constructor Summary | |
|---|---|
TaggedOutputStream(OutputStream out,
TagSet tagSet,
ActionSet actionSet)
Create a Tagged Output stream. |
|
TaggedOutputStream(OutputStream out,
TagSet tagSet,
ActionSet actionSet,
boolean littleEndian)
Create a Tagged Output stream. |
|
| Method Summary | |
|---|---|
protected TagHeader |
createTagHeader(Tag tag,
long len)
Returns newly created TagHeader. |
protected int |
getTagAlignment()
Specifies tag alignment: 1 byte, 2 short, 4 int and 8 long. |
void |
writeAction(Action action)
Write action. |
protected abstract void |
writeActionHeader(ActionHeader header)
Writes the ActionHeader, which includes an actionCode and a length. |
void |
writeTag(Tag tag)
Write a tag. |
protected abstract void |
writeTagHeader(TagHeader header)
Writes the TagHeader, which includes a TagID and a length. |
| Methods inherited from class org.freehep.util.io.ByteCountOutputStream |
|---|
append, close, getBufferLength, getLength, popBuffer, popBufferBytes, pushBuffer, write |
| 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 org.freehep.util.io.BitOutputStream |
|---|
byteAlign, finish, flushByte, minBits, minBits, minBits, writeBitFlag, writeFBits, writeSBits, writeUBits |
| Methods inherited from class org.freehep.util.io.CompressableOutputStream |
|---|
startCompressing, write |
| Methods inherited from class java.io.FilterOutputStream |
|---|
flush, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.freehep.util.io.TaggedOutput |
|---|
close |
| Methods inherited from interface java.io.DataOutput |
|---|
write, write |
| Field Detail |
|---|
protected TagSet tagSet
protected ActionSet actionSet
| Constructor Detail |
|---|
public TaggedOutputStream(OutputStream out,
TagSet tagSet,
ActionSet actionSet)
out - stream to writetagSet - allowable tag setactionSet - allowable action set
public TaggedOutputStream(OutputStream out,
TagSet tagSet,
ActionSet actionSet,
boolean littleEndian)
out - stream to writetagSet - allowable tag setactionSet - allowable action setlittleEndian - true if stream is little endian| Method Detail |
|---|
protected abstract void writeTagHeader(TagHeader header)
throws IOException
header - TagHeader to write
IOException - if write failsprotected int getTagAlignment()
public void writeTag(Tag tag)
throws IOException
TaggedOutput
writeTag in interface TaggedOutputtag - tag to write
IOException - if write fails
protected TagHeader createTagHeader(Tag tag,
long len)
protected abstract void writeActionHeader(ActionHeader header)
throws IOException
header - ActionHeader to write
IOException - if write fails
public void writeAction(Action action)
throws IOException
action - action to write
IOException - if write fails
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||