java - is String(byte[], charset) memory efficient -


i looking @ source code volley, java networking library android, , puts entire network response new string object using constructor new string(byte[], string)

where bulk of network response byte[] , headers parsed string.

is creating large string way memory efficient? i've seen network calls inputstreams converted strings in while loop , can crash application when application runs out of memory.

you don't efficient compared what, question doesn't have answer, overall agree you. response body after headers should made available input stream. infinitely long after all. reading entire requests or responses (or files) memory poor practice, , not 'efficient' several measures, example memory usage , latency.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -