private boolean readMetaTable ( ReadStream is , int crc ) throws IOException { byte [ ] key = new byte [ TABLE_KEY_SIZE ] ; is . read ( key , 0 , key . length ) ; crc = Crc32Caucho . generate ( crc , key ) ; int rowLength = BitsUtil . readInt16 ( is ) ; crc = Crc32Caucho . generateInt16 ( crc , rowLength ) ; int keyOffset = BitsUtil . readInt16 ( is ) ; crc = Crc32Caucho . generateInt16 ( crc , keyOffset ) ; int keyLength = BitsUtil . readInt16 ( is ) ; crc = Crc32Caucho . generateInt16 ( crc , keyLength ) ; int dataLength = BitsUtil . readInt16 ( is ) ; crc = Crc32Caucho . generateInt16 ( crc , dataLength ) ; byte [ ] data = new byte [ dataLength ] ; is . read ( data ) ; crc = Crc32Caucho . generate ( crc , data ) ; int crcFile = BitsUtil . readInt ( is ) ; if ( crcFile != crc ) { log . fine ( "meta-table crc mismatch" ) ; System . out . println ( "meta-table crc mismatch" ) ; return false ; } RowUpgrade row = new RowUpgrade10 ( keyOffset , keyLength ) . read ( data ) ; TableEntry10 table = new TableEntry10 ( key , rowLength , keyOffset , keyLength , row ) ; _tableList . add ( table ) ; return true ; }
Reads metadata for a table .