@Override public void close() throws IOException { is.close(); } }
@Override public void close() throws IOException { is.close(); } }
@Override public void close() throws IOException { if (closed) { return; } try { if (eventInput != null) { eventInput.close(); } } finally { closed = true; } }
@Override public void close() throws IOException { try { super.close(); } finally { if (sizeProvider instanceof Closeable) { Closeables.closeQuietly((Closeable) sizeProvider); } } } }
@Override public void close() throws IOException { try { super.close(); } finally { if (sizeProvider instanceof Closeable) { Closeables.closeQuietly((Closeable) sizeProvider); } } } }
eventInput.close(); eventInput = null;
/** * Opens and initialize this reader. */ private void doOpen() throws IOException { try { eventInput = eventInputSupplier.getInput(); decoder = new BinaryDecoder(eventInput); // If position is <= 0, the reader is not being used yet, hence needs to initialize. if (position <= 0) { init(); } else { // If position > 0, the reader has already been initialized. // We just need to seek to beginning of a data-block, depending on whether there is event in the buffer if (streamEventBuffer.hasEvent()) { // If there is event in the buffer, we seek to the data block that come after the buffered events // to prepare for the reading of the data block after the current buffered events are fully consumed. eventInput.seek(streamEventBuffer.getEndPosition()); } else { // Otherwise, we seek to the current position, which should be pointing to the beginning of a data block eventInput.seek(position); } } } catch (IOException e) { if (eventInput != null) { eventInput.close(); eventInput = null; } throw e; } }