@Override public InputStream getInputStream() { return getInputStream(0, -1); }
@Override public InputStream getInputStream() { return getInputStream(0, -1); }
@Override public InputStream getInputStream() { return getInputStream(0, -1); }
@Override public Reader getCharacterStream() throws IOException { return new InputStreamReader(getInputStream(), Charset.forName(encoding).newDecoder()); }
@Override public Reader getCharacterStream() throws IOException { return new InputStreamReader(getInputStream(), Charset.forName(encoding).newDecoder()); }
@Override public Reader getCharacterStream() throws IOException { return new InputStreamReader(getInputStream(), Charset.forName(encoding).newDecoder()); }
@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)); }
@Override public InputStream getInputStream() throws IOException { if (!saved) { if (!returned) { returned = true; return sis; } //save the rest of the stream SaveOnReadInputStream.this.fsos.flush(); long start = SaveOnReadInputStream.this.fsisf.getLength(); SaveOnReadInputStream.this.close(); //force the pending read InputStream is = SaveOnReadInputStream.this.fsisf.getInputStream(start, -1); sis.setIn(is); } return fsisf.getInputStream(); }
@Override public InputStream getInputStream() throws IOException { if (!saved) { if (!returned) { returned = true; return sis; } //save the rest of the stream SaveOnReadInputStream.this.fsos.flush(); long start = SaveOnReadInputStream.this.fsisf.getLength(); SaveOnReadInputStream.this.close(); //force the pending read InputStream is = SaveOnReadInputStream.this.fsisf.getInputStream(start, -1); sis.setIn(is); } return fsisf.getInputStream(); }
@Override public InputStream getInputStream() throws IOException { if (!saved) { if (!returned) { returned = true; return sis; } //save the rest of the stream SaveOnReadInputStream.this.fsos.flush(); long start = SaveOnReadInputStream.this.fsisf.getLength(); SaveOnReadInputStream.this.close(); //force the pending read InputStream is = SaveOnReadInputStream.this.fsisf.getInputStream(start, -1); sis.setIn(is); } return fsisf.getInputStream(); }
@Test public void testInputStream() throws IOException { FileStore fs = BufferManagerFactory.getStandaloneBufferManager().createFileStore("test"); FileStoreInputStreamFactory factory = new FileStoreInputStreamFactory(fs, Streamable.ENCODING); OutputStream os = factory.getOuputStream(0); os.write(new byte[2]); os.close(); InputStream is = factory.getInputStream(0, 1); is.read(); assertEquals(-1, is.read()); }