/** * Create a datasource from an input stream. * * @param aIs An InputStream. * @param aType A String. * @throws IOException IOException * @since 1.0 */ public ByteArrayDataSource(final InputStream aIs, final String aType) throws IOException { this.type = aType; this.byteArrayDataSource(aIs); }
/** * Create a datasource from a byte array. * * @param data A byte[]. * @param aType A String. * @throws IOException IOException * @since 1.0 */ public ByteArrayDataSource(final byte[] data, final String aType) throws IOException { this.type = aType; ByteArrayInputStream bis = null; try { bis = new ByteArrayInputStream(data); this.byteArrayDataSource(bis); } finally { if (bis != null) { bis.close(); } } }
/** * Create a datasource from an input stream. * * @param aIs An InputStream. * @param aType A String. * @throws IOException IOException * @since 1.0 */ public ByteArrayDataSource(final InputStream aIs, final String aType) throws IOException { this.type = aType; this.byteArrayDataSource(aIs); }
/** * Create a datasource from a byte array. * * @param data A byte[]. * @param aType A String. * @throws IOException IOException * @since 1.0 */ public ByteArrayDataSource(final byte[] data, final String aType) throws IOException { this.type = aType; ByteArrayInputStream bis = null; try { bis = new ByteArrayInputStream(data); this.byteArrayDataSource(bis); } finally { if (bis != null) { bis.close(); } } }