public void testDecodingFileWithBufferedSessionData() throws Exception {
ReadableByteChannel channel = new ReadableByteChannelMockup(
new String[] {"stuff; ", "more stuff; ", "a lot more stuff!!!"}, "US-ASCII");
HttpParams params = new BasicHttpParams();
SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, params);
HttpTransportMetricsImpl metrics = new HttpTransportMetricsImpl();
LengthDelimitedDecoder decoder = new LengthDelimitedDecoder(
channel, inbuf, metrics, 36);
int i = inbuf.fill(channel);
assertEquals(7, i);
File fileHandle = File.createTempFile("testFile", ".txt");
RandomAccessFile testfile = new RandomAccessFile(fileHandle, "rw");