I'm using milton server to support webdav protocol in my project but there is a problem. This is my upload (PUT) method code:
public DavFile upload(InputStream is, String name) {
DavFile davFile = null;
if (is != null) {
File newFile = new File(name);
BufferedOutputStream os = null;
byte[] buffer = new byte[1024 * 1024];
int size;
try {
os = new BufferedOutputStream(new FileOutputStream(newFile, false), buffer.length);
while ((size = is.read(buffer)) > 0) {
System.out.println("Log: " + name + " | " + size);
os.write(buffer, 0, size);
}
Util.closeOutputStream(os);
davFile = new DavFile(newFilePath);
} catch (Exception ex) {
Util.writeLog(ex);
} finally {
Util.closeInputStream(is);
Util.closeOutputStream(os);
}
}
return davFile;
}
and this is the output:
Log: 722267_119335884931029_2021941220_n.mp4 | 7834
Log: 722267_119335884931029_2021941220_n.mp4 | 7834
Log: 722267_119335884931029_2021941220_n.mp4 | 7834
Log: 722267_119335884931029_2021941220_n.mp4 | 7834
Log: 722267_119335884931029_2021941220_n.mp4 | 7834
Log: 722267_119335884931029_2021941220_n.mp4 | 7834
Log: 722267_119335884931029_2021941220_n.mp4 | 7834
Log: 722267_119335884931029_2021941220_n.mp4 | 7834
Log: 722267_119335884931029_2021941220_n.mp4 | 7834
Log: 722267_119335884931029_2021941220_n.mp4 | 7834
Log: 722267_119335884931029_2021941220_n.mp4 | 7834
Log: 722267_119335884931029_2021941220_n.mp4 | 7834
Log: 722267_119335884931029_2021941220_n.mp4 | 7834
Log: 722267_119335884931029_2021941220_n.mp4 | 7834
Log: 722267_119335884931029_2021941220_n.mp4 | 7834
Log: 722267_119335884931029_2021941220_n.mp4 | 7834
Log: 722267_119335884931029_2021941220_n.mp4 | 3145
How can i increase the read size of InputStream in milton server? I can not change InputStream to any other type like BufferedInputStream!
In my local computer uploa speed is 27KB/s and this is too slow!!!