jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ted Roeloffzen" <ted.roeloff...@gmail.com>
Subject Re: Retrieving binary content
Date Tue, 28 Nov 2006 11:14:41 GMT
>
>
>
> A common pattern I use when processing stream data is:
>
>    InputStream data = ...;
>    try {
>        byte[] buffer = new byte[BUFFER_SIZE];
>        for (int n = data.read(buffer); n != -1; n = data.read(buffer)) {
>            // process n bytes of data in buffer
>        }
>    } finally {
>        data.close();

 }



When I do this, i need to know how large the buffer needs to be, but i don't
know how big it is.
Is there a way to go around that?

Ted

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message