@Override public InputStream getInputStream() throws IOException { List<InputStream> streams = new ArrayList<InputStream>(ew.includes.size() * 2 + 1); long last = 0; for (int i = 0; i < ew.includes.size(); i++) { Include include = ew.includes.get(i); streams.add(fsisf.getInputStream(last, include.start - last)); last = include.start; try { streams.add(((BaseLob)include.streamable.getReference()).getBinaryStream()); } catch (SQLException e) { throw new IOException(e); } } streams.add(fsisf.getInputStream(last, -1)); return new SequenceInputStream(Collections.enumeration(streams)); }
@Override public InputStream getInputStream() throws IOException { List<InputStream> streams = new ArrayList<InputStream>(ew.includes.size() * 2 + 1); long last = 0; for (int i = 0; i < ew.includes.size(); i++) { Include include = ew.includes.get(i); streams.add(fsisf.getInputStream(last, include.start - last)); last = include.start; try { streams.add(((BaseLob)include.streamable.getReference()).getBinaryStream()); } catch (SQLException e) { throw new IOException(e); } } streams.add(fsisf.getInputStream(last, -1)); return new SequenceInputStream(Collections.enumeration(streams)); }
@Override public InputStream getInputStream() throws IOException { List<InputStream> streams = new ArrayList<InputStream>(ew.includes.size() * 2 + 1); long last = 0; for (int i = 0; i < ew.includes.size(); i++) { Include include = ew.includes.get(i); streams.add(fsisf.getInputStream(last, include.start - last)); last = include.start; try { streams.add(((BaseLob)include.streamable.getReference()).getBinaryStream()); } catch (SQLException e) { throw new IOException(e); } } streams.add(fsisf.getInputStream(last, -1)); return new SequenceInputStream(Collections.enumeration(streams)); }
public Reader getCharacterStream() throws SQLException { try { Reader r = this.getStreamFactory().getCharacterStream(); if (r != null) { return r; } } catch (IOException e) { SQLException ex = new SQLException(e.getMessage()); ex.initCause(e); throw ex; } Charset cs = getCharset(); if (cs == null) { cs = Streamable.CHARSET; } return new InputStreamReader(getBinaryStream(), cs.newDecoder()); }
public Reader getCharacterStream() throws SQLException { try { Reader r = this.getStreamFactory().getCharacterStream(); if (r != null) { return r; } } catch (IOException e) { SQLException ex = new SQLException(e.getMessage()); ex.initCause(e); throw ex; } Charset cs = getCharset(); if (cs == null) { cs = Streamable.CHARSET; } return new InputStreamReader(getBinaryStream(), cs.newDecoder()); }
/** * Returns the number of bytes. */ public long length() throws SQLException{ if (getStreamFactory().getLength() == -1) { getStreamFactory().setLength(length(getBinaryStream())); } return getStreamFactory().getLength(); }
/** * Returns the number of bytes. */ public long length() throws SQLException{ if (getStreamFactory().getLength() == -1) { getStreamFactory().setLength(length(getBinaryStream())); } return getStreamFactory().getLength(); }