8192 bytes when creating file

arrays, java

Solution

That it uses a buffer to read and write 8kB blocks at once. The number is fairly arbitary, but for performance reasons it makes sense to use a multiple of 512 bytes when writing a file, and preferably a multiple of the disks cluster size. 8kB is a reasonable buffer size for most purposes.

Problem

In my Java code I have function that gets file from the client in http request and converts that in to the file. I have this line there: ``` byte[] buffer = new byte[8192]; ``` what does 8192 bytes (8 kb) means here? This is one of the responses that I got, and want to make sure that I understand that code.

Original source

Related problems