Package com.pixelmed.dicom

# Class DicomStreamCopier

java.lang.Object
com.pixelmed.dicom.DicomStreamCopier

public class DicomStreamCopier extends Object

A class to copy DICOM attributes from anm input stream to an output stream, converting the encoding of the attributes between transfer syntaxes if necessary.

See Also:
  - `DicomInputStream`
  - `DicomOutputStream`

## Constructor Summary

Constructors
Constructor
Description
`DicomStreamCopier(DicomInputStream i, DicomOutputStream o)`
Copy a dicom input stream to a dicom output stream, using any meta information header if present in input, but not copying it.

## Method Summary

Modifier and Type
Method
Description
`static void`
`main(String[] arg)`
Copy one file to another parsing and recreating the DICOM attributes using the specified transfer syntaxes.

### Methods inherited from class java.lang.Object

`clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### DicomStreamCopier

public DicomStreamCopier(DicomInputStream i, DicomOutputStream o) throws DicomException, IOException

Copy a dicom input stream to a dicom output stream, using any meta information header if present in input, but not copying it.

Implements the CP 1066 proposal to handle values too long to fit in Explicit VR by writing a UN rather than the actual VR.

Parameters:
  `i` - the input stream
  `o` - the output stream, which is closed after the copy is done
Throws:
  `IOException` - if an I/O error occurs
  `DicomException` - if error in DICOM encoding

## Method Details

### main

public static void main(String[] arg)

Copy one file to another parsing and recreating the DICOM attributes using the specified transfer syntaxes.

Parameters:
  `arg` - four arguments, the input transfer syntax uid (must be zero length if metaheader present), the input filename, the output transfer syntax uid and the output filename