Code example for AssetFileDescriptor

Methods: close

0
  } 
 
  void checkClosedStreams() throws IOException { 
    if (!connected) { return; }
    if (fd != null && (inputClosed || inputStream == null) && (outputClosed || outputStream == null)) {
      fd.close();
      fd = null;
    } 
  } 
 
  protected void ensureConnected() throws IOException { 
    if (!connected) { connect(); }
  } 
 
  @Override 
  public InputStream getInputStream() throws IOException {
    if (inputClosed) {
      throw new IOException("input is closed");
    } 
    ensureConnected(); 
    return inputStream;