dap4/d4lib/src/main/java/dap4/dap4lib/HttpDSP.java
protected void
    build()
            throws DapException
    {
        String methodurl = buildURL(this.xuri.assemble(XURI.URLONLY), DATASUFFIX, this.dmr, this.basece);

        InputStream stream;
        // Make the request and return an input stream for accessing the databuffer
        // Should fill in bigendian and stream fields
        stream = callServer(methodurl);

        try {
            ChunkInputStream reader;
            if(DEBUG) {
                byte[] raw = DapUtil.readbinaryfile(stream);
                ByteArrayInputStream bis = new ByteArrayInputStream(raw);
                DapDump.dumpbytestream(raw, getOrder(), "httpdsp.build");
                reader = new ChunkInputStream(bis, RequestMode.DAP, getOrder());
            } else {
                // Wrap the input stream as a ChunkInputStream
                reader = new ChunkInputStream(stream, RequestMode.DAP, getOrder());
            }

            // Extract and "compile" the server response
            String document = reader.readDMR();
            // Extract all the remaining bytes
            byte[] bytes = DapUtil.readbinaryfile(reader);
            // use super.build to compile
            super.build(document, bytes, getOrder());
        } catch (Throwable t) {
            t.printStackTrace();
            throw new DapException(t);
        } finally {
            try {
                stream.close();
            } catch (IOException ioe) {/*ignore*/}
        }
    }
protected void
    build()
            throws DapException
    {
        String methodurl = buildURL(this.xuri.assemble(XURI.URLONLY), DATASUFFIX, this.dmr, this.basece);

        InputStream stream;
        // Make the request and return an input stream for accessing the databuffer
        // Should fill in bigendian and stream fields
        stream = callServer(methodurl);

        try {
            ChunkInputStream reader;
            if(DEBUG) {
                byte[] raw = DapUtil.readbinaryfile(stream);
                ByteArrayInputStream bis = new ByteArrayInputStream(raw);
                DapDump.dumpbytestream(raw, getOrder(), "httpdsp.build");
                reader = new ChunkInputStream(bis, RequestMode.DAP, getOrder());
            } else {
                // Wrap the input stream as a ChunkInputStream
                reader = new ChunkInputStream(stream, RequestMode.DAP, getOrder());
            }

            // Extract and "compile" the server response
            String document = reader.readDMR();
            // Extract all the remaining bytes
            byte[] bytes = DapUtil.readbinaryfile(reader);
            // use super.build to compile
            super.build(document, bytes, getOrder());
        } catch (Throwable t) {
            t.printStackTrace();
            throw new DapException(t);
        } finally {
            try {
                stream.close();
            } catch (IOException ioe) {/*ignore*/}
        }
    }
Open a connection and make a request for the (possibly constrained) DMR.

@throws DapException