protected DicomDirReader(RandomAccessFile raf, FileSetInformation fileSetInfo) throws IOException { this.raf = raf; this.in = new DicomInputStream(raf, TransferSyntax.ExplicitVRLittleEndian); this.filesetInfo = fileSetInfo; }
public void readDicomObject(DicomObject dest, int len) throws IOException { DicomObject oldAttrs = attrs; this.attrs = dest; try { parse(len, Tag.ItemDelimitationItem); } finally { this.attrs = oldAttrs; } }
public DicomDirReader(RandomAccessFile raf) throws IOException { this.raf = raf; in = new DicomInputStream(raf); in.setHandler(new StopTagInputHandler(Tag.DirectoryRecordSequence)); filesetInfo = new FileSetInformation(); in.readDicomObject(filesetInfo.getDicomObject(), -1); in.setHandler(in); }
public void readItem(DicomObject dest) throws IOException { dest.setItemOffset(pos); if (readHeader() != Tag.Item) throw new DicomCodingException("Expected (FFFE,E000) but read " + TagUtils.toString(tag)); readDicomObject(dest, vallen); }
private boolean hasZLIBHeader() throws IOException { if (!markSupported()) return false; byte[] buf = header; mark(2); read(buf, 0, 2); reset(); return ((((buf[0] & 0xff) << 8) | (buf[1] & 0xff)) == ZLIB_HEADER); }
public void writeFileMetaInformation(DicomObject attrs) throws IOException { if (preamble != null) { write(preamble, 0, PREAMBLE_LENGTH); write('D'); write('I'); write('C'); write('M'); } this.ts = TransferSyntax.ExplicitVRLittleEndian; writeElements(attrs.fileMetaInfoIterator(), true, new ItemInfo(attrs .fileMetaInfoIterator(), true)); }
private ItemInfo createItemInfo(DicomObject attrs) { if (needItemInfo()) return new ItemInfo(attrs.datasetIterator(), includeGroupLength); return null; }
public void writeCommand(DicomObject attrs) throws IOException { this.ts = TransferSyntax.ImplicitVRLittleEndian; writeElements(attrs.commandIterator(), true, new ItemInfo(attrs .commandIterator(), true)); }
/** * Use a DataOutput or ImageOutputStream as a destination. * @param dout to send the dicom data to. */ public DicomOutputStream(DataOutput dout) { super(new DataOutputStreamAdapter(dout)); }
public final void setExplicitItemLengthIfZero( boolean explicitItemLengthIfZero) { out.setExplicitItemLengthIfZero(explicitItemLengthIfZero); }
public final void setExplicitSequenceLengthIfZero( boolean explicitSequenceLengthIfZero) { out.setExplicitSequenceLengthIfZero(explicitSequenceLengthIfZero); }
public DicomInputStream(InputStream in) throws IOException { super(in); this.ts = guessTransferSyntax(); }
public final void setIncludeGroupLength(boolean includeGroupLength) { out.setIncludeGroupLength(includeGroupLength); }
public final boolean isExplicitItemLengthIfZero() { return out.isExplicitItemLengthIfZero(); }
public final void setExplicitSequenceLength(boolean explicitSequenceLength) { out.setExplicitSequenceLength(explicitSequenceLength); }
public final boolean isIncludeGroupLength() { return out.isIncludeGroupLength(); }
public final boolean isExplicitSequenceLength() { return out.isExplicitSequenceLength(); }
public final boolean isExplicitSequenceLengthIfZero() { return out.isExplicitSequenceLengthIfZero(); }
public final void readFully(byte b[]) throws IOException { readFully(b, 0, b.length); }