format/src/main/java/com/github/sadikovi/riff/FileReader.java
/**
   * Read file header and footer that is cached by this reader for subsequent requests.
   * This method should be invoked separately from `prepareRead()`, and after this call type
   * header is available with `getFileHeader()` and footer is available with `getFileFooter()`.
   * @param readFooter when set to true, reads footer as well, otherwise only header
   * @throws FileNotFoundException if file does not exist
   * @throws IOException if IO error occurs
   */
Read file header and footer that is cached by this reader for subsequent requests.
Read file header and footer that is cached by this reader for subsequent requests .
public void readFileInfo(boolean readFooter) throws FileNotFoundException, IOException {
    if (readPrepared) throw new IOException("Reader reuse");
    FSDataInputStream in = null;
    try {
      in = fs.open(fileStatus.getPath(), hdfsBufferSize);
      fileHeader = FileHeader.readFrom(in);
      if (readFooter) {
        fileFooter = FileFooter.readFrom(in, fileStatus.getLen());
      }
      readPrepared = true;
    } finally {
      if (in != null) {
        in.close();
      }
    }
  }
public void readFileInfo ( boolean readFooter ) throws FileNotFoundException , IOException { if ( readPrepared ) throw new IOException ( "Reader reuse" ) ; FSDataInputStream in = null ; try { in = fs . open ( fileStatus . getPath ( ) , hdfsBufferSize ) ; fileHeader = FileHeader . readFrom ( in ) ; if ( readFooter ) { fileFooter = FileFooter . readFrom ( in , fileStatus . getLen ( ) ) ; } readPrepared = true ; } finally { if ( in != null ) { in . close ( ) ; } } }
Read file header and footer that is cached by this reader for subsequent requests.
Read file header and footer that is cached by this reader for subsequent requests .