@Override public InputStream openInputStreamWithAutoDestroy() throws IOException { if (onDiskFile == null) { return super.openInputStreamWithAutoDestroy(); } return new FileInputStream(onDiskFile) { @Override public void close() throws IOException { super.close(); destroy(); } }; }
/** * Create a new wrapper around a temporary buffer. * * @param buffer * the buffer to initialize stream and length from. The * buffer will be destroyed on {@link #close()} * @throws IOException * in case of an error opening the stream to the buffer. */ public LfsInputStream(TemporaryBuffer buffer) throws IOException { this.stream = buffer.openInputStreamWithAutoDestroy(); this.length = buffer.length(); }
.toByteArray(MAX_EXCEPTION_TEXT_SIZE)))); return result.getStdout().openInputStreamWithAutoDestroy();
@Override public InputStream openInputStreamWithAutoDestroy() throws IOException { if (onDiskFile == null) { return super.openInputStreamWithAutoDestroy(); } return new FileInputStream(onDiskFile) { @Override public void close() throws IOException { super.close(); destroy(); } }; }
/** * Create a new wrapper around a temporary buffer. * * @param buffer * the buffer to initialize stream and length from. The * buffer will be destroyed on {@link #close()} * @throws IOException * in case of an error opening the stream to the buffer. */ public LfsInputStream(TemporaryBuffer buffer) throws IOException { this.stream = buffer.openInputStreamWithAutoDestroy(); this.length = buffer.length(); }
.toByteArray(MAX_EXCEPTION_TEXT_SIZE)))); return result.getStdout().openInputStreamWithAutoDestroy();