question: public static String checkIndexHeaderSuffix ( DataInput in , String expectedSuffix ) throws IOException { int suffixLength = in . readByte ( ) & 0xFF ; byte suffixBytes [ ] = new byte [ suffixLength ] ; in . readBytes ( suffixBytes , 0 , suffixBytes . length ) ; String suffix = new String ( suffixBytes , 0 , suffixBytes . length , StandardCharsets . UTF_8 ) ; if ( ! suffix . equals ( expectedSuffix ) ) { throw new CorruptIndexException ( "file mismatch, expected suffix=" + expectedSuffix + ", got=" + suffix , in ) ; } return suffix ; }
target:  Expert: just reads and verifies the suffix of an index header 