【发布时间】:2016-01-13 12:43:16
【问题描述】:
Univocity Parsers, "Cannot resolve method writeValue(int)" 出现以下代码,在 IntelliJ 中打开,任何帮助将不胜感激:
public void write(){
// Writing to an in-memory byte array. This will be printed out to the standard output so you can easily see the result.
ByteArrayOutputStream csvResult = new ByteArrayOutputStream();
// CsvWriter (and all other file writers) work with an instance of java.io.Writer
Writer outputWriter = new OutputStreamWriter(csvResult);
TsvWriter writer = new TsvWriter(outputWriter, new TsvWriterSettings());
writer.writeHeaders("A", "B", "C", "D", "E");
//writes a value to the first column
writer.writeValue(10);
//writes a value to the second column
writer.writeValue(20);
//writes a value to the fourth column (index 3 represents the 4th column - the one with header "D")
writer.writeValue(3, 40);
//overrides the value in the first column. "A" indicates the header name.
writer.writeValue("A", 100.0);
//flushes all values to the output, creating a row.
writer.writeValuesToRow();
}
【问题讨论】: