Why did I get an inputStream with nothing, but it contains information like headers,
Int r = is. Read (bytes) r is -1
`
RandomAccessFile raf = new RandomAccessFile(new File("D:\"+flowFilename), "rw");
//Seek to position
raf.seek((flowChunkNumber - 1) * flowChunkSize);
//Save to file
InputStream is = request.getInputStream();
long readed = 0;
long content_length = request.getContentLength();
byte[] bytes = new byte[1024 * 100];
while(readed < content_length) {
int r = is.read(bytes);
if (r < 0) {
break;
}
raf.write(bytes, 0, r);
readed += r;
}
raf.close();
Why did I get an inputStream with nothing, but it contains information like headers, Int r = is. Read (bytes) r is -1 `
RandomAccessFile raf = new RandomAccessFile(new File("D:\"+flowFilename), "rw");
`