public void activate(IUploadFile file, boolean showAscii, int bytesPerLine, IRequestCycle cycle)
{
setFile(file);
StringWriter writer = null;
BinaryDumpOutputStream out = null;
InputStream in = null;
try
{
in = file.getStream();
writer = new StringWriter();
out = new BinaryDumpOutputStream(writer);
out.setShowAscii(showAscii);
out.setBytesPerLine(bytesPerLine);
byte[] buffer = new byte[1000];
while (true)
{
int length = in.read(buffer);
if (length < 0)
break;
out.write(buffer, 0, length);
}
in.close();
in = null;
out.close();
out = null;
setFileDump(writer.getBuffer().toString());
writer.close();