java - BufferedinputStream default buffer size -


bufferedinputstream default buffer size 8k jvm. harcoded value, or can changed altering system parameter?

i'd use 128k without modifying java code. possible?

thanks,

there no way change default buffer size system property. must use constructor accepts size argument. place buffer created in constructor:

public bufferedinputstream(inputstream in, int size) {     super(in);     if (size <= 0) {         throw new illegalargumentexception("buffer size <= 0");     }     buf = new byte[size]; } 

this applies jvm version (1.8.0_31) possibly different on other implementations.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

html - href attribute breaking an element -

html - How can i make an element from a bottom stacking context stays in front of another higher stacking context? -