Code example for FileInputStream

Methods: getChannel

0
      _inputStream = new FileInputStream(_file);
      _inputStream.getChannel().position(_prevOffset);
      _lastModifiedTimestamp = newLastModifiedTs;
    } else { 
      // Even if sync did not happen, we should align channel position with the offset 
      _inputStream.getChannel().position(_prevOffset);
    } 
 
    //Re-align the curOffset 
    _currOffset = _inputStream.getChannel().position();
    return doSync;
  } 
 
  @Override 
  public synchronized void close() throws IOException 
  { 
    LOG.info("Closing ConcurrentAppendableSingleFileInputStream for file :" + _file);
    _closed = true;
    closeStream(); 
    notifyAll();
  }