I set the record listener parameter to null (see code below) and ran it.
Got a RecordFormatException: The content of an excel record cannot
exceed 8224 bytes exception.
Using poi-3.8-beta3
----
package biffviewerexample;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.PrintStream;
import org.apache.poi.hssf.dev.BiffViewer;
public class BiffViewerExample {
public BiffViewerExample(String filename) {
try {
InputStream inputStream = new FileInputStream(filename);
FileOutputStream fileOutputStream = new
FileOutputStream("C:\\BiffViewerOutput.txt");
PrintStream printStream = new PrintStream(fileOutputStream);
//BiffViewer.BiffRecordListener biffRecordListener = new
BiffRecordListener();
boolean dumpInterpretedRecords = true;
BiffViewer.createRecords(inputStream, printStream, null,
dumpInterpretedRecords);
printStream.close();
fileOutputStream.close();
inputStream.close();
}
catch (org.apache.poi.hssf.record.RecordFormatException e){
System.err.println ("BiffViewerExample: RecordFormatException" + e);
}
catch (Exception e){
System.err.println ("BiffViewerExample: Error in writing to file" + e);
}
//String[] stringArray = new String[1];
//stringArray[0] = filename;
//BiffViewer.main(stringArray);
}
public static void main(String[] args) {
String filename = "C:\\test.xls";
new BiffViewerExample (filename);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]