@Test
public void testSFPig() throws Exception {
byte[] buf = new byte[1024];
FakeFSOutputStream os = new FakeFSOutputStream(buf);
StoreFunc sfunc = new PigStorage("\t");
sfunc.bindTo(os);
DataByteArray[] input = { new DataByteArray("amy"),
new DataByteArray("bob"), new DataByteArray("charlene"),
new DataByteArray("david"), new DataByteArray("erin"),
new DataByteArray("frank") };
Tuple f1 = Util.loadTuple(TupleFactory.getInstance().newTuple(input.length), input);
sfunc.putNext(f1);
sfunc.finish();
FakeFSInputStream is = new FakeFSInputStream(buf);
LoadFunc lfunc = new PigStorage();
lfunc.bindTo(null, new BufferedPositionedInputStream(is), 0, buf.length);
Tuple f2 = lfunc.getNext();