code: public void write(OutputStream ostream) throws IOException
     {
        try
        {
           for (Range range : ranges_)
           {
              InputStream istream = null;
              if (resource_ instanceof VersionResource)
                 istream = ((VersionResource)resource_).getContentAsStream();
              else
                 istream = ((FileResource)resource_).getContentAsStream();
  
              println(ostream);
              // boundary
              print("--" + WebDavConst.BOUNDARY, ostream);
              println(ostream);
              // content-type
              print(ExtHttpHeaders.CONTENT_TYPE + ": " + contentType_, ostream);
              println(ostream);
              // current range
              print(ExtHttpHeaders.CONTENTRANGE + ": bytes " + range.getStart() + "-" + range.getEnd() + "/"
                 + contentLength_, ostream);
              println(ostream);
              println(ostream);
              // range data
              RangedInputStream rangedInputStream = new RangedInputStream(istream, range.getStart(), range.getEnd());
  
              byte buff[] = new byte[0x1000];
              int rd = -1;
              while ((rd = rangedInputStream.read(buff)) != -1)
                 ostream.write(buff, 0, rd);
              rangedInputStream.close();
           }
           println(ostream);
           print("--" + WebDavConst.BOUNDARY + "--", ostream);
           println(ostream);
        }
        catch (IOException exc)
        {
           LOG.error(exc.getMessage(), exc);
           throw new IOException("Can't write to stream, caused " + exc, exc);
        }
        catch (RepositoryException exc)
        {
           LOG.error(exc.getMessage(), exc);
           throw new IOException("Can't write to stream, caused " + exc, exc);
        }
     }
docs: {@inheritDoc}