BufferedPositionedInputStream bpis =
new BufferedPositionedInputStream( is );
// Put a boundary on half the file and just half a line,
// it should automaically read till end of line
PigLineRecordReader reader = new PigLineRecordReader( bpis, 0,
( ( text.length() + 1 ) * ( LOOP_COUNT/2 ) )
- (text.length()/2 ) );
Text value = new Text();
int counter = 0;
for( int i = 0; i < LOOP_COUNT / 2; i++ ) {
reader.next(value);
assertEquals( "Invalid Text", value.toString().compareTo(text),
0 );
counter++;
}
assertEquals( "Invalid bytes read", reader.getPosition() ,
counter * ( text.length() + 1 ) );
testFile.deleteOnExit();
} catch (IOException e) {