Guava FileBackedOutputStream - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Guava FileBackedOutputStream class.

This code example shows how to use the following methods:reset
         // we must call FileBackedOutputStream.reset to remove temporary file 
         return new FilterInputStream(out.asByteSource().openStream()) {
            @Override 
            public void close() throws IOException {
               super.close(); 
               out.reset();
            } 
         }; 
      } catch (IOException e) {
         throw new RuntimeException("Error tapping line", e);
      } finally { 
         closeQuietly(out);
         closeQuietly(instream);
      } 
   } 
 
   public InputStream input(InputStream instream) {
      return copy("<< ", checkNotNull(instream, "input"));
   } 
 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:reset
	public InputStream getInputStream() throws IOException {
		return backer.getSupplier().getInput();
	} 
 
	public void resetBacker() throws IOException {
		backer.reset();
	} 
 
	@Override 
	public int read(byte[] b, int off, int len) throws IOException {
		int amt = super.read(b, off, len);
		if(amt != -1) {
			backer.write(b,off,amt);
		} 
		return amt;
	} 
 
	@Override 
	public int read() throws IOException {
		int r = super.read();
4
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Guava FileBackedOutputStream Methods: