public String readLine() throws IOException {
		if (!targetFile.getChannel().isOpen()) {
			logger.warn("targetFile is not open!");
			return null;
		}

		while (true) {
			if (bufferPosition < 0) {
				if (filePosition == 0) {
					if (outputStream == null) {
						return null;
					}
					String line = bufToString();
					outputStream = null;
					return line;
				}

				long start = Math.max(filePosition - BUFFER_SIZE, 0);
				long end = filePosition;
				long readSize = end - start;

				buffer = channel.map(FileChannel.MapMode.READ_ONLY, start, readSize);
				bufferPosition = (int)readSize;
				filePosition = start;
			}

			while (bufferPosition-- > 0) {
				byte c = buffer.get(bufferPosition);
				if (c == '\r' || c == '\n') {
					if (c != lastLineBreak) {
						lastLineBreak = c;
						continue;
					}
					lastLineBreak = c;
					return bufToString();
				}
				outputStream.write(c);
			}
		}
	}