code: public void writeTo(OutputStream output)
              throws ApplicationUnavailableException {
          InputStream input = getInstance().getReader(this);
  
          try {
              V1Util.copyStream(input, output);
          } catch (IOException e) {
              throw new ApplicationUnavailableException(e);
          } finally {
              if (input != null) {
                  try {
                      input.close();
                  } catch (IOException e) {
                      // do nothing
                  }
              }
          }
      }
docs: Write this attachment's content to the output stream.
  
  @param output Stream to write the content to.
  @throws ApplicationUnavailableException if coping fails.