## dods.dap
Class DataDDS

    java.lang.Object
      dods.dap.DDS
          dods.dap.DataDDS

All Implemented Interfaces:
  Cloneable

public class DataDDS
extends DDS

The DataDDS class extends DDS to add new methods for retrieving data from the server, and printing out the contents of the data.

See Also:
  `DDS`

Field Summary

Fields inherited from class dods.dap.DDS
`name, vars`

Constructor Summary
`DataDDS(ServerVersion ver)` Construct the DataDDS with the given server version.
`DataDDS(ServerVersion ver, BaseTypeFactory btf)`

Method Summary
`void` `externalize(OutputStream os, boolean compress, boolean headers)` Dump the dataset using externalize methods.
`ServerVersion` `getServerVersion()` Returns the `ServerVersion` given in the constructor.
`void` `printVal(OutputStream os)` Print the dataset using OutputStream.
`void` `printVal(PrintWriter os)` Print the dataset just read.
`void` `readData(InputStream is, StatusUI statusUI)` Read the data stream from the given InputStream.

Methods inherited from class dods.dap.DDS
`addVariable, checkSemantics, checkSemantics, clone, delVariable, getFactory, getName, getVariable, getVariables, numVariables, parse, print, print, search, setName`

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DataDDS

    public DataDDS(ServerVersion ver)

  Construct the DataDDS with the given server version.

Parameters:
  `ver` - the ServerVersion returned from the open DODS connection.

### DataDDS

    public DataDDS(ServerVersion ver,
                   BaseTypeFactory btf)

Method Detail

### getServerVersion

    public final ServerVersion getServerVersion()

  Returns the `ServerVersion` given in the constructor.

  Returns:
    the `ServerVersion` given in the constructor.

### readData

    public void readData(InputStream is,
                         StatusUI statusUI)
                  throws IOException,
                         EOFException,
                         DODSException

  Read the data stream from the given InputStream. In the C++ version, this code was in Connect.

  Parameters:
    `is` - the InputStream to read from
    `statusUI` - the StatusUI object to use, or null
  Throws:
    `EOFException` - if EOF is found before the variable is completely deserialized.
    `IOException` - thrown on any other InputStream exception.
    `DataReadException` - when invalid data is read, or if the user cancels the download.
    `DODSException` - if the DODS server returned an error.

### printVal

    public void printVal(PrintWriter os)

  Print the dataset just read. In the C++ version, this code was in `geturl`.

  Parameters:
    `os` - the `PrintWriter` to use.

### printVal

    public final void printVal(OutputStream os)

  Print the dataset using OutputStream.

  Parameters:
    `os` - the `OutputStream` to use.

### externalize

    public final void externalize(OutputStream os,
                                  boolean compress,
                                  boolean headers)
                           throws IOException

  Dump the dataset using externalize methods. This should create a multipart Mime document with the binary representation of the DDS that is currently in memory.

  Parameters:
    `os` - the `OutputStream` to use.
    `compress` - `true` if we should compress the output.
    `headers` - `true` if we should print HTTP headers.
  Throws:
    `IOException` - thrown on any `OutputStream` exception.