Package org.dcm4che3.data

Examples of org.dcm4che3.data.Fragments.trimToSize()


    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;
    }

    public Attributes readFileMetaInformation() throws IOException {
View Full Code Here


            return;
        }
        Attributes attrs = new Attributes(seq.getParent().bigEndian());
        seq.add(attrs);
        readAttributes(attrs, length, Tag.ItemDelimitationItem);
        attrs.trimToSize();
    }

    @Override
    public void readValue(DicomInputStream dis, Fragments frags)
            throws IOException {
View Full Code Here

            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;
    }

    private void readFragments(Attributes attrs, int fragsTag, VR vr)
            throws IOException {
View Full Code Here

                skipAttribute(UNEXPECTED_ATTRIBUTE);
        }
        if (frags.isEmpty())
            attrs.setNull(fragsTag, vr);
        else {
            frags.trimToSize();
            attrs.setValue(fragsTag, vr, frags);
        }
    }

    public byte[] readValue() throws IOException {
View Full Code Here

        }
        Fragments frags = attrs.newFragments(tag, vr, 10);
        for (;;) {
            switch (next()) {
            case END_ARRAY:
                frags.trimToSize();
                return;
            case VALUE_NULL:
                frags.add(null);
                break;
            case START_OBJECT:
View Full Code Here

                skipAttribute(UNEXPECTED_ATTRIBUTE);
        }
        if (seq.isEmpty())
            attrs.setNull(sqtag, VR.SQ);
        else
            seq.trimToSize();
    }

    private void addItemPointer(int sqtag, String privateCreator, int itemIndex) {
        if (itemPointers == null)
            itemPointers = new ArrayList<ItemPointer>(8);
View Full Code Here

            public void onDataset(Attributes fmi, Attributes item) {
                seq.add(item);
            }});

        fmi = fmi0;
        seq.trimToSize();
    }

    private byte[] readInlineBinary() {
        if (next() != Event.VALUE_STRING) {
            throw new JsonParsingException("Unexpected " + event
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.