DicomInputStream extends InputStream { public DicomObject readCommandSet() throws IOException { return parser.readCommandSet(); } DicomInputStream(InputStream in); DicomEncoding getEncoding(); DicomInputStream withEncoding(DicomEncoding encoding); DicomInputStream withLimit(int limit); DicomInputStream withParseItems(Predicate<DicomElement> parseItemsPredicate); DicomInputStream withParseItemsLazy(int seqTag); DicomInputStream withBulkData(Predicate<DicomElement> bulkDataPredicate); DicomInputStream withBulkDataURIProducer(Function<DicomInputStream, String> bulkDataURIProducer); DicomInputStream withBulkDataURI(Path sourcePath); DicomInputStream withInputHandler(DicomInputHandler handler); DicomInputHandler getInputHandler(); DicomInputStream spoolBulkDataTo(Path path); DicomInputStream spoolBulkData(Supplier<Path> bulkDataSpoolPathSupplier); long getStreamPosition(); @Override int read(); @Override int read(byte[] b, int off, int len); @Override void close(); DicomObject readFileMetaInformation(); DicomObject getFileMetaInformation(); DicomObject readCommandSet(); DicomObject readDataSet(); boolean readDataSet(DicomObject dcmObj); StringBuilder promptFilePreambleTo(StringBuilder appendTo, int maxLength); StringBuilder promptTo(DicomElement dcmElm, StringBuilder appendTo, int maxLength); StringBuilder promptTo(DataFragment dataFragment, StringBuilder appendTo, int maxLength); void loadValueFromStream(); void writeValueTo(DicomElement dcmElm, DicomOutputStream dos); void skipBytes(int off, int length, OutputStream out); String bulkDataURI(); static boolean isBulkData(DicomElement el);  }
@Test void readCommandSet() throws IOException { DicomObject cmd; try (InputStream in = new ByteArrayInputStream(C_ECHO_RQ)) { cmd = new DicomInputStream(in).readCommandSet(); } assertNotNull(cmd); assertEquals(48, cmd.getInt(Tag.CommandField).orElseGet(Assertions::fail)); Assertions.assertEquals(UID.VerificationSOPClass, cmd.getString(Tag.AffectedSOPClassUID).orElseGet(Assertions::fail)); }