@Override
	public boolean nextKeyValue() throws IOException, InterruptedException {
		List<String> lines = new ArrayList<String>();
		if ( lastValue != null ){
			key = lastKey;
			lines.add(lastValue.toString() );
			lastKey = null; lastValue = null;
		}
		while ( reader.nextKeyValue() ){
			String line = reader.getCurrentValue().toString();
			SplitableLocation pair = MultilineInputFormat.checkSplitable(line, sString, eString);
			boolean added = false;
			if ( pair.lSplitable ){
				if ( lines.size() == 0 ){
					key = reader.getCurrentKey();
					lines.add(reader.getCurrentValue().toString());
					added = true;
				} else {
					value = new TextArrayWritable(convert(lines));
					lastKey = reader.getCurrentKey();
					lastValue = reader.getCurrentValue();
					return true;
				}
			}
			if ( pair.rSplitable ){
				if ( !added ){
					lines.add(reader.getCurrentValue().toString());
				}
				value = new TextArrayWritable(convert(lines));
				lastKey = null; lastValue = null;
				return true;
			}
			if ( ! added ){
				if ( lines.size() == 0 ){
					key = reader.getCurrentKey();
				}
				lines.add(reader.getCurrentValue().toString());
			}
		}
		if ( lines.size() > 0 ){
			value = new TextArrayWritable(convert(lines));
			return true;
		}
		return false;
	}