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
Post a Comment