/** * Include the streamable value, rather than inlining. * @param s * @return true if the value could be included * @throws IOException */ public boolean include(Streamable<?> s) throws IOException { if (includes.size() == MAX_INCLUDES) { return false; } out.flush(); long length = fsisf.getLength(); includes.add(new Include(length, s)); return true; }
/** * Include the streamable value, rather than inlining. * @param s * @return true if the value could be included * @throws IOException */ public boolean include(Streamable<?> s) throws IOException { if (includes.size() == MAX_INCLUDES) { return false; } out.flush(); long length = fsisf.getLength(); includes.add(new Include(length, s)); return true; }
/** * Include the streamable value, rather than inlining. * @param s * @return true if the value could be included * @throws IOException */ public boolean include(Streamable<?> s) throws IOException { if (includes.size() == MAX_INCLUDES) { return false; } out.flush(); long length = fsisf.getLength(); includes.add(new Include(length, s)); return true; }
@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(); }