MCPcopy Create free account
hub / github.com/davidgiven/luje / close

Method close

lib/java/io/FileInputStream.java:154–174  ·  view source on GitHub ↗

Closes this stream. @throws IOException if an error occurs attempting to close this stream.

()

Source from the content-addressed store, hash-verified

152 * if an error occurs attempting to close this stream.
153 */
154 @Override
155 public void close() throws IOException {
156 if (fd == null) {
157 // if fd is null, then the underlying file is not opened, so nothing
158 // to close
159 return;
160 }
161// if (channel != null) {
162// synchronized (channel) {
163// if (channel.isOpen()) {
164// channel.close();
165// }
166// }
167// }
168 synchronized (this) {
169 if (fd.descriptor >= 0) {
170 fileSystem.close(fd.descriptor);
171 fd.descriptor = -1;
172 }
173 }
174 }
175
176 /**
177 * Ensures that all resources for this stream are released when it is about

Callers

nothing calls this directly

Calls 1

closeMethod · 0.65

Tested by

no test coverage detected