Hi,
I am putMethod(path, inputstream) binary documents (Word, PDF, etc) into the
Slide repository (2.1b1) and then retrieving them into an OutputStream for
download via the getMethod. Using:
InputStream is = resource.getMethodData().
byte [] info = new byte[ resource.getContentLength() ];
is.read( info );
out.write( info );
This will write "invalid" data into the stream such that the parent
applcation (ie, Word) will not recognize it, and barfs.
However, if I replace these calls with writing to a temporary File, it
works, all the time every time.
byte [] info = new byte[ resource.getContentLength() ];
File file = new File("temp");
boolean ok = resource.getMethod(file);
FileInputStream fis = new FileInputStream(file);
fis.read(info);
out.write( info );
Any ideas why this occurs ?