CADI.Server.LogicalTarget.JPEG2000.Codestream
Class PacketHeaderDataOutputStream

java.lang.Object
  extended by CADI.Server.LogicalTarget.JPEG2000.Codestream.PacketHeaderDataOutputStream

public class PacketHeaderDataOutputStream
extends java.lang.Object

This class implements a data output stream for the packet header encoder machinery. It includes all necessary bits to ensure that the packet header will not contain any of code-stream's delimiting marker codes (0xFF90 to 0xFFFF).

Version:
1.0.1 2008/12/27
Author:
Group on Interactive Coding of Images (GICI)

Field Summary
(package private)  BufferedDataOutputStream bufferedDataOutputStream
           
private static int DEFAULT_BUFFER_SIZE
          Indicates the default size of the buffer which will be used to encode the packet header.
(package private)  byte t
          Index and buffer for bit stuffing
(package private)  byte T
          Index and buffer for bit stuffing
 
Constructor Summary
PacketHeaderDataOutputStream()
          Constructor.
PacketHeaderDataOutputStream(BufferedDataOutputStream bufferedDataOutputStream)
          Constructor.
 
Method Summary
 void bitStuffing()
          Bit stuffing up to 8 bits.
 void emitTagBit(byte x)
          Add a bit to the packet header.
 byte[] getByteArray()
          Returns the array of bytes.
 void list(java.io.PrintStream out)
          Prints this Packet Header Data Output Stream out to the specified output stream.
 void reset()
          Sets attributes to their initial values.
 void setInput(BufferedDataOutputStream bufferedDataOutputStream)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

bufferedDataOutputStream

BufferedDataOutputStream bufferedDataOutputStream

t

byte t
Index and buffer for bit stuffing


T

byte T
Index and buffer for bit stuffing


DEFAULT_BUFFER_SIZE

private static final int DEFAULT_BUFFER_SIZE
Indicates the default size of the buffer which will be used to encode the packet header.

See Also:
Constant Field Values
Constructor Detail

PacketHeaderDataOutputStream

PacketHeaderDataOutputStream()
Constructor.


PacketHeaderDataOutputStream

PacketHeaderDataOutputStream(BufferedDataOutputStream bufferedDataOutputStream)
Constructor.

Parameters:
bufferedDataOutputStream -
Method Detail

reset

public void reset()
Sets attributes to their initial values.


setInput

public void setInput(BufferedDataOutputStream bufferedDataOutputStream)
Parameters:
bufferedDataOutputStream -

emitTagBit

public void emitTagBit(byte x)
                throws java.io.IOException
Add a bit to the packet header. Ensure that the packet header will not contain any of code-stream's delimiting marker codes (0xFF90 to 0xFFFF).

Parameters:
x - bit to be packect.
Throws:
java.io.IOException

bitStuffing

public void bitStuffing()
                 throws java.io.IOException
Bit stuffing up to 8 bits.

Throws:
java.io.IOException

getByteArray

public byte[] getByteArray()
Returns the array of bytes.

Returns:
an array of bytes.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

list

public void list(java.io.PrintStream out)
Prints this Packet Header Data Output Stream out to the specified output stream. This method is useful for debugging.

Parameters:
out - an output stream.


CADI - Copyright (C) 2007
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Group on Interactive Coding of Images (GICI) (contact)