output.close();
assertEquals( "wrong size", 89967L, file.length() ); // just makes sure the file size doesnt change from expected
TupleInputStream input = new HadoopTupleInputStream( new FileInputStream( file ), tupleSerialization.getElementReader() );
int k = -1;
for( int i = 0; i < 501; i++ )
{
Tuple tuple = input.readTuple();
int value = tuple.getInteger( 0 );
assertTrue( "wrong diff", value - k == 1 );
assertTrue( "wrong type", tuple.getObject( 3 ) instanceof TestText );
assertTrue( "wrong type", tuple.getObject( 4 ) instanceof Tuple );
assertTrue( "wrong type", tuple.getObject( 5 ) instanceof BytesWritable );
byte[] bytes = ( (BytesWritable) tuple.getObject( 5 ) ).getBytes();
String string = new String( bytes, 0, bytes.length > 1 ? bytes.length - 1 : bytes.length, "UTF-8" );
assertEquals( "wrong value", Integer.parseInt( string ), i );
assertTrue( "wrong type", tuple.getObject( 6 ) instanceof BooleanWritable );
k = value;
}
input.close();
System.out.println( "time = " + ( System.currentTimeMillis() - time ) );
}