package com.dtstack.logstash.input.fileinput;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.dtstack.logstash.inputs.File;
import com.dtstack.logstash.inputs.ReadLineUtil;

public class Test {
	
	public void test(){
		Map<String, String> config = new HashMap<String, String>();
		config.put("codec", "plain");
		List<String> path = new ArrayList<String>();
		path.add("E:\\controller.log");
		path.add("E:\\server.log");
		
		File file = new File(config);
//		File.path = path;
		file.prepare();
		file.emit();
	}
	
	public void testReadLine() throws Exception{
		java.io.File file = new java.io.File("D:\\testReadLine.txt");
		ReadLineUtil readLineUtil = new ReadLineUtil(file, "UTF-8", 0);
		String line = null;
		while((line = readLineUtil.readLine()) != null){
			System.out.println(line);
		}
		
		System.out.println(readLineUtil.getCurrBufPos());
		
	}
	
	public static void main(String[] args) throws IOException {
		Test test = new Test();
//		test.testReadLine();
	}

}

@@ -1007,16 +1007,18 @@
 ption %7B%0A
+//
 %09%09Test t
@@ -1060,14 +1060,77 @@
 Line();%0A
+%09%09System.out.println(Long.MAX_VALUE/1024/1024/1024/1024/1024);%0A
 %09%7D%0A%0A%7D%0A

add test