I want to send file with OutputStream,
so I use byte[] = new byte[size of file ]
but I don\'t know what the max size is that i can use.
Th
Well, this is a quite dangerous way to read files. int
in Java is 32-bit int, so it resides in range -2147483648 - 2147483647, while long
is 64 bit.
Generally you shouldn't read the whole file at once because your program may exhaust your RAM on big files. Use a BufferedReader on top of FileReader instead.