[jmsl] Getting MusicShape from PHP

jmsl at music.columbia.edu jmsl at music.columbia.edu
Mon Apr 13 18:21:03 EDT 2009


do you mean StringBuffer?
Nick

jmsl at music.columbia.edu wrote:
> Hi Chi,
>
> You might also use StringBuilder instead of += with string.  If you 
> have a file with 1000 lines, using += will create 1000 strings (since 
> strings are immutable) and chew up memory.  Using StringBuilder will 
> only create the string at the end, saving you memory.  Sample code below.
>
> StringBuilder input = new StringBuilder();
>
> try {
>
> BufferedReader br = new BufferedReader(new 
> InputStreamReader(httpUrlConnection.getInputStream()));
>
> String line;
>
> while ((line = br.readLine()) != null)
>
> input.append(line);
>
> br.close();
>
> }
>
> String outString = input.toString();
>
>
>
> _______________________________________________
> jmsl mailing list
> jmsl at music.columbia.edu
> http://music.columbia.edu/mailman/listinfo/jmsl


More information about the jmsl mailing list