/** * Returns an input stream containing this object's data, or null if there is * no data associated with the object. * <p> * If you are downloading data from a service, you should consider verifying the * integrity of the data you read from this stream using one of the * {@link #verifyData(InputStream)} methods. * * @return * input stream containing the object's service-side data, or null if no data. * * @throws ServiceException */ public InputStream getDataInputStream() throws ServiceException { if (dataInputStream == null && dataInputFile != null) { try { // Use a repeatable file data input stream, so transmissions can be retried if necessary. dataInputStream = new RepeatableFileInputStream(dataInputFile); } catch (FileNotFoundException e) { throw new ServiceException("Cannot open file input stream", e); } } return dataInputStream; }
/** * Returns an input stream containing this object's data, or null if there is * no data associated with the object. * <p> * If you are downloading data from a service, you should consider verifying the * integrity of the data you read from this stream using one of the * {@link #verifyData(InputStream)} methods. * * @return * input stream containing the object's service-side data, or null if no data. * * @throws ServiceException */ public InputStream getDataInputStream() throws ServiceException { if (dataInputStream == null && dataInputFile != null) { try { // Use a repeatable file data input stream, so transmissions can be retried if necessary. dataInputStream = new RepeatableFileInputStream(dataInputFile); } catch (FileNotFoundException e) { throw new ServiceException("Cannot open file input stream", e); } } return dataInputStream; }