org.dicom4j.network.protocoldataunit.support
Class ProtocolDataUnit

java.lang.Object
  extended by org.dicom4j.network.protocoldataunit.support.ProtocolDataUnit
All Implemented Interfaces:
ProtocolDataUnit
Direct Known Subclasses:
AAbortPDU, AbstractAReleasePDU, AbstractProtocolDataUnitItem, AbstractUserInformationSubItem, AssociateRJPDU, AssociateRQACPDU, PDataTFPDU, PresentationContextItem, UserInformationItem

public abstract class ProtocolDataUnit
extends Object
implements ProtocolDataUnit

Abstract implement of ProtocolDataUnit

Since:
0.0.0
Author:
Laurent Lecomte

Nested Class Summary
 class ProtocolDataUnit.Types
          Deprecated. see ProtocolDataUnitType
 
Method Summary
static void checkStream(BinaryInputStream stream)
           
abstract  int getLength()
          Return the length of the Protocol Data Unit
 String getName()
          Return the name of the Protocol Data Unit
 SOPClassRegistry getSopClassRegistry()
          return the SOPClassRegistry
abstract  ProtocolDataUnitType getType()
           return the type of the Protocol Data Unit TODO change to ProtocolType
abstract  void read(BinaryInputStream aStream, int aLength)
          Read the Protocol Data Unit from a stream
 void setSopClassRegistry(SOPClassRegistry sopClassRegistry)
          set the SOPClassRegistry
 byte[] toBytes()
          Return the Protocol Data Unit as bytes
 String toString()
          the ProtocolDataUnit as a string
static String typetoString(byte aType)
          return a type of PDU as String
abstract  void write(BinaryOutputStream aStream)
          Write the Protocol Data Unit to a stream
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

checkStream

public static void checkStream(BinaryInputStream stream)
                        throws DicomException
Throws:
DicomException

typetoString

public static String typetoString(byte aType)
return a type of PDU as String

Parameters:
aType - type of PDU
Returns:
PDU as string

getLength

public abstract int getLength()
Return the length of the Protocol Data Unit

Specified by:
getLength in interface ProtocolDataUnit
Returns:
the length

getName

public String getName()
Return the name of the Protocol Data Unit

Specified by:
getName in interface ProtocolDataUnit
Returns:
the name

toString

public String toString()
the ProtocolDataUnit as a string

Specified by:
toString in interface ProtocolDataUnit
Overrides:
toString in class Object
Returns:
ProtocolDataUnit as string

getType

public abstract ProtocolDataUnitType getType()

return the type of the Protocol Data Unit

TODO change to ProtocolType

Specified by:
getType in interface ProtocolDataUnit
Returns:
the type
Since:
0.0.0

read

public abstract void read(BinaryInputStream aStream,
                          int aLength)
                   throws DicomException,
                          IOException
Read the Protocol Data Unit from a stream

Parameters:
aStream -
aLength -
Throws:
DicomException
IOException

toBytes

public byte[] toBytes()
               throws DicomException,
                      IOException
Return the Protocol Data Unit as bytes

Returns:
PDU as bytes
Throws:
DicomException
IOException

write

public abstract void write(BinaryOutputStream aStream)
                    throws DicomException,
                           IOException
Write the Protocol Data Unit to a stream

Parameters:
aStream -
Throws:
DicomException
IOException

getSopClassRegistry

public SOPClassRegistry getSopClassRegistry()
Description copied from interface: ProtocolDataUnit
return the SOPClassRegistry

Specified by:
getSopClassRegistry in interface ProtocolDataUnit
Returns:
the SOPClassRegistry

setSopClassRegistry

public void setSopClassRegistry(SOPClassRegistry sopClassRegistry)
Description copied from interface: ProtocolDataUnit
set the SOPClassRegistry

Specified by:
setSopClassRegistry in interface ProtocolDataUnit
Parameters:
sopClassRegistry - the SOPClassRegistry


Copyright © 2009 dicom4j. All Rights Reserved.