private <T> int readDynamicRecords( ReadableChannel channel, T target, DynamicRecordAdder<T> adder ) throws IOException { int numberOfRecords = channel.getInt(); assert numberOfRecords >= 0; while ( numberOfRecords > 0 ) { DynamicRecord read = readDynamicRecord( channel ); if ( read == null ) { return -1; } adder.add( target, read ); numberOfRecords--; } return numberOfRecords; }
while ( deletedRecords-- > 0 ) DynamicRecord read = readDynamicRecord( channel ); if ( read == null )
while ( deletedRecords-- > 0 ) DynamicRecord read = readDynamicRecord( channel ); if ( read == null )
private RelationshipTypeTokenRecord readRelationshipTypeTokenRecord( int id, ReadableChannel channel ) throws IOException { // in_use(byte)+type_blockId(int)+nr_type_records(int) byte inUseFlag = channel.get(); boolean inUse = false; if ( (inUseFlag & Record.IN_USE.byteValue()) == Record.IN_USE.byteValue() ) { inUse = true; } else if ( inUseFlag != Record.NOT_IN_USE.byteValue() ) { throw new IOException( "Illegal in use flag: " + inUseFlag ); } RelationshipTypeTokenRecord record = new RelationshipTypeTokenRecord( id ); record.setInUse( inUse ); record.setNameId( channel.getInt() ); int nrTypeRecords = channel.getInt(); for ( int i = 0; i < nrTypeRecords; i++ ) { DynamicRecord dr = readDynamicRecord( channel ); if ( dr == null ) { return null; } record.addNameRecord( dr ); } return record; }
private LabelTokenRecord readLabelTokenRecord( int id, ReadableChannel channel ) throws IOException { // in_use(byte)+type_blockId(int)+nr_type_records(int) byte inUseFlag = channel.get(); boolean inUse = false; if ( (inUseFlag & Record.IN_USE.byteValue()) == Record.IN_USE.byteValue() ) { inUse = true; } else if ( inUseFlag != Record.NOT_IN_USE.byteValue() ) { throw new IOException( "Illegal in use flag: " + inUseFlag ); } LabelTokenRecord record = new LabelTokenRecord( id ); record.setInUse( inUse ); record.setNameId( channel.getInt() ); int nrTypeRecords = channel.getInt(); for ( int i = 0; i < nrTypeRecords; i++ ) { DynamicRecord dr = readDynamicRecord( channel ); if ( dr == null ) { return null; } record.addNameRecord( dr ); } return record; }
private <T> int readDynamicRecords( ReadableChannel channel, T target, DynamicRecordAdder<T> adder ) throws IOException { int numberOfRecords = channel.getInt(); assert numberOfRecords >= 0; while ( numberOfRecords > 0 ) { DynamicRecord read = readDynamicRecord( channel ); if ( read == null ) { return -1; } adder.add( target, read ); numberOfRecords--; } return numberOfRecords; }
private RelationshipTypeTokenRecord readRelationshipTypeTokenRecord( int id, ReadableChannel channel ) throws IOException { // in_use(byte)+type_blockId(int)+nr_type_records(int) byte inUseFlag = channel.get(); boolean inUse = false; if ( (inUseFlag & Record.IN_USE.byteValue()) == Record.IN_USE.byteValue() ) { inUse = true; } else if ( inUseFlag != Record.NOT_IN_USE.byteValue() ) { throw new IOException( "Illegal in use flag: " + inUseFlag ); } RelationshipTypeTokenRecord record = new RelationshipTypeTokenRecord( id ); record.setInUse( inUse ); record.setNameId( channel.getInt() ); int nrTypeRecords = channel.getInt(); for ( int i = 0; i < nrTypeRecords; i++ ) { DynamicRecord dr = readDynamicRecord( channel ); if ( dr == null ) { return null; } record.addNameRecord( dr ); } return record; }
private LabelTokenRecord readLabelTokenRecord( int id, ReadableChannel channel ) throws IOException { // in_use(byte)+type_blockId(int)+nr_type_records(int) byte inUseFlag = channel.get(); boolean inUse = false; if ( (inUseFlag & Record.IN_USE.byteValue()) == Record.IN_USE.byteValue() ) { inUse = true; } else if ( inUseFlag != Record.NOT_IN_USE.byteValue() ) { throw new IOException( "Illegal in use flag: " + inUseFlag ); } LabelTokenRecord record = new LabelTokenRecord( id ); record.setInUse( inUse ); record.setNameId( channel.getInt() ); int nrTypeRecords = channel.getInt(); for ( int i = 0; i < nrTypeRecords; i++ ) { DynamicRecord dr = readDynamicRecord( channel ); if ( dr == null ) { return null; } record.addNameRecord( dr ); } return record; }