public Attributes readCommand() throws IOException { if (bigEndian || explicitVR) throw new IllegalStateException( "bigEndian=" + bigEndian + ", explicitVR=" + explicitVR ); Attributes attrs = new Attributes(9); readAttributes(attrs, -1, -1); return attrs; }
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); init(in.readInt()); @SuppressWarnings("resource") DicomInputStream din = new DicomInputStream(in, bigEndian ? UID.ExplicitVRBigEndianRetired : UID.ExplicitVRLittleEndian); din.readAttributes(this, -1, Tag.ItemDelimitationItem); }
public void transcode(Handler handler) throws IOException { this.handler = handler; dis.readAttributes(dataset, -1, -1); if (dos == null) { initDicomOutputStream(); writeDataset(); } else if (postPixelData != null) dos.writeDataset(null, postPixelData); }
public Attributes readItem() throws IOException { readHeader(); if (tag != Tag.Item) throw new IOException("Unexpected attribute " + TagUtils.toString(tag) + " #" + length + " @ " + pos); Attributes attrs = new Attributes(bigEndian); attrs.setItemPosition(tagPos); readAttributes(attrs, length, Tag.ItemDelimitationItem); attrs.trimToSize(); return attrs; }
public Attributes readDataset(int len, int stopTag) throws IOException { handler.startDataset(this); readFileMetaInformation(); Attributes attrs = new Attributes(bigEndian, 64); readAttributes(attrs, len, stopTag); attrs.trimToSize(); handler.endDataset(this); return attrs; }
@Override public void readValue(DicomInputStream dis, Sequence seq) throws IOException { checkIsThis(dis); if (length == 0) { seq.add(new Attributes(seq.getParent().bigEndian(), 0)); return; } Attributes attrs = new Attributes(seq.getParent().bigEndian()); seq.add(attrs); readAttributes(attrs, length, Tag.ItemDelimitationItem); attrs.trimToSize(); }
} else { try { dis.readAttributes(ds, -1, -1); } catch (EOFException e) {}; } else { try { dis.readAttributes(ds, -1, -1); } catch (EOFException e) {};