CADI.Common.Network.JPIP
Class JPIPMessageHeader

java.lang.Object
  extended by CADI.Common.Network.JPIP.JPIPMessageHeader
All Implemented Interfaces:
ClassIdentifiers

public class JPIPMessageHeader
extends java.lang.Object
implements ClassIdentifiers

This class contains the values of the JPIP message header.

Further information, see ISO/IEC 15444-9 section A.2

Version:
1.0 2007/10/26
Author:
Group on Interactive Coding of Images (GICI)

Field Summary
 int Aux
          If present, it represents a non-negative integer value, formed by concatenating the leas significant 7 bits of each byte in the VBAS in big-endian order.
 int classIdentifier
          If present, provides a message class identifier.
 int CSn
          If present, identifies the index (stating from 0) of the codestream to which the data-bin belongs.
 int EORCode
          Definition in EORCodes.
 long inClassIdentifier
           
 boolean isEOR
          Indicates if this JPIP Message is an End of Response Message.
 boolean isLastByte
          Bin-ID = [BinIdIndicator, completeDataBin, InClassIdentifier] Bin-ID format:
MSB LSB 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 ----------------- ----------------- ----------------- |a|b b|c|d d d d| |a|d d d d d d d| |a|d d d d d d d| ..... ----------------- ----------------- ----------------- Bits 6 and 5 of the first, BinIDIndicator, byte indicate whether the Class and CSn VBASs are present in the message header.
 long msgLength
          Identifies the total number of bytes in the body of the message.
 long msgOffset
          Identifies the offset of the data in the message from the start of the data-bin.
 
Fields inherited from interface CADI.Common.Network.JPIP.ClassIdentifiers
EXTENDED_PRECINCT, EXTENDED_TILE, MAIN_HEADER, METADATA, PRECINCT, TILE, TILE_HEADER
 
Constructor Summary
JPIPMessageHeader()
          Default constructor.
JPIPMessageHeader(int EORCode, int MsgLength)
          Constructor for EOR message header.
JPIPMessageHeader(int CSn, int classIdentifier, long inClassIdentifier, long msgOffset, long msgLength, boolean isLastByte, int Aux)
          Constructor.
JPIPMessageHeader(JPIPMessageHeader jpipMessageHeader)
          Constructor.
 
Method Summary
 void list(java.io.PrintStream out)
          Prints this JPIP Message Header fields out to the specified output stream.
 void reset()
          Sets the attributes to its initial vaules.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

isLastByte

public boolean isLastByte
Bin-ID = [BinIdIndicator, completeDataBin, InClassIdentifier] Bin-ID format:
MSB LSB 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 ----------------- ----------------- ----------------- |a|b b|c|d d d d| |a|d d d d d d d| |a|d d d d d d d| ..... ----------------- ----------------- -----------------

Bits 6 and 5 of the first, BinIDIndicator, byte indicate whether the Class and CSn VBASs are present in the message header. Next table defines the bit values and its meaning

Indicator Meaning
0 Prohibited
1 No Class or CSn VBAS is present in message header
2 Class VBAS is present but CSn is no present in message header
3 Class and CSn VBAS are both present in the message header

Bit 4, completeDataBin, of the first byte of the Bin-ID indicates whether or not this message contains the last byte in the asociated data-bin: '0' means it is not the last byte in the data-bin; '1' inidates tat it is the last byte in the data-bin.

The remaining 4 bits of the first byte and the 7 low order bits of any remaining bytes in the Bin-ID VBAS form an "in-class identifier".


inClassIdentifier

public long inClassIdentifier

classIdentifier

public int classIdentifier
If present, provides a message class identifier. The message class identifier is a non-negative integer, formed by concatenating the least significant 7 bits of each byte of the VBAS in big-endian order. If no present, the message class identifier is unchanged form that associated with the previous message. If the Class VBAS is not present and there is no previous message, the message class identifier is 0.

Class identifier Message class Data-bin class Stream type
0 Precinct data-bin message Precinct data-bin JPP-stream only
1 Extended precinct data-bin message Precinct data-bin JPP-stream only
2 Tile header data-bin message Tile header data-bin JPP-stream only
4 Tile data-bin message Tile data-bin JPT-stream only
5 Extended precinct data-bin message Tile data-bin JPT-stream only
6 Main header data-bin message Main heaer data-bin JPP- and JPT-stream
8 Metadata-bin message Metadata-bin JPP and JPT-stream

Allowed values, see ClassIdentifiers.


CSn

public int CSn
If present, identifies the index (stating from 0) of the codestream to which the data-bin belongs. The codestream index is formed by concatenating the leas significant 7 bits of each byte of the VBAS in big-endian order. If the CSn VBAS is no present, the codestream index is unchanged from the previous message. If CSn VBAS is no present and there is no previous message, the codestream index is 0.


msgOffset

public long msgOffset
Identifies the offset of the data in the message from the start of the data-bin. It is a non-negative integer value, formed by concatenating the least significant 7 bits of each byte in the VBAS in big-endian order.


msgLength

public long msgLength
Identifies the total number of bytes in the body of the message. It is a non-negative integer value, formed by concatenating the least significant 7 bits of each byte in the VBAS in big-endian order.


Aux

public int Aux
If present, it represents a non-negative integer value, formed by concatenating the leas significant 7 bits of each byte in the VBAS in big-endian order.

Its presence and meaning if present, is determined by the message class identifier foun within the Bin-ID VBAS.


isEOR

public boolean isEOR
Indicates if this JPIP Message is an End of Response Message.


EORCode

public int EORCode
Definition in EORCodes.

Further information, see ISO/IEC 15444-9 sect. D.3

Constructor Detail

JPIPMessageHeader

public JPIPMessageHeader()
Default constructor.


JPIPMessageHeader

public JPIPMessageHeader(int CSn,
                         int classIdentifier,
                         long inClassIdentifier,
                         long msgOffset,
                         long msgLength,
                         boolean isLastByte,
                         int Aux)
Constructor.

Parameters:
CSn - definition in CSn
classIdentifier - definition in classIdentifier
inClassIdentifier - definition in inClassIdentifier
msgOffset - definition in msgOffset
msgLength - definition in msgLength
isLastByte - definition in isLastByte
Aux - definition in Aux

JPIPMessageHeader

public JPIPMessageHeader(JPIPMessageHeader jpipMessageHeader)
Constructor.

Parameters:
jpipMessageHeader - an object of this class

JPIPMessageHeader

public JPIPMessageHeader(int EORCode,
                         int MsgLength)
Constructor for EOR message header.

Parameters:
EORCode -
MsgLength -
Method Detail

reset

public void reset()
Sets the attributes to its initial vaules.


toString

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

list

public void list(java.io.PrintStream out)
Prints this JPIP Message Header fields 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)