/** * Closes the file input stream of the input format. */ @Override public void close() throws IOException { if (this.stream != null) { // close input stream this.stream.close(); stream = null; } }
public void close() throws IOException { this.wrapBuffer = null; this.readBuffer = null; if (this.stream != null) { this.stream.close(); } }
/** * Closes the file input stream of the input format. */ @Override public void close() throws IOException { if (this.stream != null) { // close input stream this.stream.close(); stream = null; } }
public void close() throws IOException { this.wrapBuffer = null; this.readBuffer = null; if (this.stream != null) { this.stream.close(); } }
public void close() throws IOException { stream.close(); } }
/** * Double checked procedure setting the abort flag and closing the stream. */ private final void abortWait() { this.aborted = true; final FSDataInputStream inStream = this.fdis; this.fdis = null; if (inStream != null) { try { inStream.close(); } catch (Throwable t) {} } } }
/** * Double checked procedure setting the abort flag and closing the stream. */ private final void abortWait() { this.aborted = true; final FSDataInputStream inStream = this.fdis; this.fdis = null; if (inStream != null) { try { inStream.close(); } catch (Throwable t) {} } } }
@Override protected void implCloseChannel() throws IOException { if (this.outputStream != null) { this.outputStream.close(); this.outputStream = null; } if (this.inputStream != null) { this.inputStream.close(); this.inputStream = null; } } }
@Override protected void implCloseChannel() throws IOException { if (this.outputStream != null) { this.outputStream.close(); this.outputStream = null; } if (this.inputStream != null) { this.inputStream.close(); this.inputStream = null; } } }
private final boolean fillBuffer() throws IOException { int toRead = this.lengthLeft > this.readBuffer.length ? this.readBuffer.length : (int) this.lengthLeft; if (this.lengthLeft <= 0) { toRead = this.readBuffer.length; this.overLimit = true; } int read = this.stream.read(this.readBuffer, 0, toRead); if (read == -1) { this.stream.close(); this.stream = null; return false; } else { this.lengthLeft -= read; this.readPos = 0; this.limit = read; return true; } }
private final boolean fillBuffer() throws IOException { int toRead = this.lengthLeft > this.readBuffer.length ? this.readBuffer.length : (int) this.lengthLeft; if (this.lengthLeft <= 0) { toRead = this.readBuffer.length; this.overLimit = true; } int read = this.stream.read(this.readBuffer, 0, toRead); if (read == -1) { this.stream.close(); this.stream = null; return false; } else { this.lengthLeft -= read; this.readPos = 0; this.limit = read; return true; } }
inStream.close();
@Override public void run() { try { final FileSystem fs = FileSystem.get(this.split.getPath().toUri()); this.fdis = fs.open(this.split.getPath()); // check for canceling and close the stream in that case, because no one will obtain it if (this.aborted) { final FSDataInputStream f = this.fdis; this.fdis = null; f.close(); } } catch (Throwable t) { this.error = t; } }
@Override public void run() { try { final FileSystem fs = FileSystem.get(this.split.getPath().toUri()); this.fdis = fs.open(this.split.getPath()); // check for canceling and close the stream in that case, because no one will obtain it if (this.aborted) { final FSDataInputStream f = this.fdis; this.fdis = null; f.close(); } } catch (Throwable t) { this.error = t; } }
final FSDataInputStream lfsinput2 = lfs.open(pathtotestfile2); assertEquals(lfsinput2.read(testbytestest), 5); lfsinput2.close(); assertTrue(Arrays.equals(testbytes, testbytestest));