KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
When reading from InputStreams, how do you decide what size to use for the byte[]? int nRead; byte[] data = new byte[16384]; // <-- this number is the one I'm wondering about while ((nRead = is.read(data, 0, data.length)) != -1) { ...do something.. } When do you use a small one vs a large one? What are the differences? Does the number want to be in increments of 1024? Does it make a difference if it is an InputStream from the network vs the disk? Thanks much, I can't seem to find a clear answer elsewhere.
Tags (comma-separated)
Save Edits
Cancel