Class DICOM_CommsLink

java.lang.Object
gov.nih.mipav.model.dicomcomm.DICOM_Comms
gov.nih.mipav.model.dicomcomm.DICOM_CommsLink

public class DICOM_CommsLink extends DICOM_Comms
It is a bit odd since it both extends DICOM_Comms and has a DICOM_Comms object. Might be best to redesign this interface structure but it works!
This DICOM communication package was originally based on the Java Dicom Package, whose license is below:
 Java Dicom Package (com.zmed.dicom)
 
  Copyright (c) 1996-1997 Z Medical Imaging Systems, Inc.
 
  This software is provided, as is, for non-commercial educational
  purposes only.   Use or incorporation of this software or derivative
  works in commercial applications requires written consent from
  Z Medical Imaging Systems, Inc.
 
  Z MEDICAL IMAGING SYSTEMS MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT
  THE SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
  BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
  FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR CONFORMANCE TO ANY
  SPECIFICATION OR STANDARD.  Z MEDICAL IMAGING SYSTEMS SHALL NOT BE
  LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING OR
  MODIFYING THIS SOFTWARE OR ITS DERIVATIVES.
 
  =============================================================================
 
  This software package is implemented similarly to the UC Davis public
  domain C++ DICOM implementation which contains the following copyright
  notice:
 
  Copyright (C) 1995, University of California, Davis
 
  THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND THE UNIVERSITY
  OF CALIFORNIA DOES NOT MAKE ANY WARRANTY ABOUT THE SOFTWARE, ITS
  PERFORMANCE, ITS MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR
  USE, FREEDOM FROM ANY COMPUTER DISEASES OR ITS CONFORMITY TO ANY
  SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND PERFORMANCE OF
  THE SOFTWARE IS WITH THE USER.
 
  Copyright of the software and supporting documentation is
  owned by the University of California, and free access
  is hereby granted as a license to use this software, copy this
  software and prepare derivative works based upon this software.
  However, any distribution of this software source code or
  supporting documentation or derivative works (source code and
  supporting documentation) must include this copyright notice.
 
  The UC Davis C++ source code is publicly available from the following
  anonymous ftp site:
 
  ftp://imrad.ucdmc.ucdavis.edu/pub/dicom/UCDMC/
 
  • Field Details

    • linkToComms

      DICOM_Comms linkToComms
      Reference to the link communications object.
  • Constructor Details

    • DICOM_CommsLink

      public DICOM_CommsLink()
  • Method Details

    • flush

      public void flush(DICOM_Comms connection, int length) throws DICOM_Exception
      Send the data out the connection (pdu).
      Parameters:
      connection - the PDU or connection (DICOM_Comms is the parent class of DICOM_PDUService)
      length - The length of data to be flushed out the port.
      Throws:
      DICOM_Exception - Throws an error when attempting to flush more bytes than are present!
    • readBinary

      public int readBinary(byte[] data, int length) throws DICOM_Exception
      Copies data from the port buffer into the a new buffer used typically in pDataTF.
      Overrides:
      readBinary in class DICOM_Comms
      Parameters:
      data - Buffer to store the data
      length - Number of bytes to be read
      Returns:
      The length of the data read in.
      Throws:
      DICOM_Exception - Throws an error if there is a problem reading the port.
    • readFill

      public void readFill(DICOM_Comms connection, int length) throws DICOM_Exception
      Sets linkToComms to connection and fills(read) the connection buffer via readBinary.
      Parameters:
      connection - The connection to the socket.
      length - The number of bytes to read.
      Throws:
      DICOM_Exception - Throws an error if there is a problem reading the port.
    • sendBinary

      public void sendBinary(byte[] data, int offset, int length) throws DICOM_Exception
      Actual binary data to be sent.
      Overrides:
      sendBinary in class DICOM_Comms
      Parameters:
      data - Buffer of data send out the port (socket)
      offset - The offset into the data indicating the starting point of the data to be sent.
      length - The number of bytes to be sent.
      Throws:
      DICOM_Exception - Throws an error if there is a problem sendting via port.