code: public Date[] removeDatastream(String id, Date start, Date end)
              throws ServerException {
          assertNotInvalidated();
          assertNotPendingRemoval();
          ArrayList<Datastream> removeList = new ArrayList<Datastream>();
          for (Datastream ds : m_obj.datastreams(id)) {
              boolean doRemove = false;
              if (start != null) {
                  if (end != null) {
                      if (ds.DSCreateDT.compareTo(start) >= 0
                              && ds.DSCreateDT.compareTo(end) <= 0) {
                          doRemove = true;
                      }
                  } else {
                      if (ds.DSCreateDT.compareTo(start) >= 0) {
                          doRemove = true;
                      }
                  }
              } else {
                  if (end != null) {
                      if (ds.DSCreateDT.compareTo(end) <= 0) {
                          doRemove = true;
                      }
                  } else {
                      doRemove = true;
                  }
              }
              if (doRemove) {
                  // Note: We don't remove old audit records by design.
  
                  // add this datastream to the datastream to-be-removed list.
                  removeList.add(ds);
              }
          }
  
          /* Now that we've identified all ds versions to remove, remove 'em */
          for (Datastream toRemove : removeList) {
              m_obj.removeDatastreamVersion(toRemove);
          }
  
          // finally, return the dates of each deleted item
          Date[] deletedDates = new Date[removeList.size()];
          for (int i = 0; i < removeList.size(); i++) {
              deletedDates[i] = (removeList.get(i)).DSCreateDT;
          }
          return deletedDates;
      }
docs: Removes a datastream from the object.
  
  @param id
  The id of the datastream.
  @param start
  The start date (inclusive) of versions to remove. If
  <code>null</code>, this is taken to be the smallest possible
  value.
  @param end
  The end date (inclusive) of versions to remove. If
  <code>null</code>, this is taken to be the greatest possible
  value.
  @throws ServerException
  If any type of error occurred fulfilling the request.