[Simpleweb-Support] FileAllocator and FixedConsummer
Brought to you by:
niallg
|
From: Christophe R. <cr...@ac...> - 2012-12-13 17:09:44
|
Hi,
It looks like a temporary file (FileBuffer) is always created even if
the request has a content length.
I have modified the append() method in FixedConsummer where I pass the
limit to the allocator:
private void append(byte[] array, int off, int len) throws IOException {
if(buffer == null) {
buffer = allocator.allocate(limit); // limit added
}
buffer.append(array, off, len);
}
Then a file will be created only if the content-length exceeds the limit.
I just wonder if this is safe?
Thanks,
Christophe
|