You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Colin Chalmers <co...@maxware.nl> on 2001/07/25 16:58:35 UTC

Patch for ByteArrayDatasource

Here is a patch for the ByteArraydatasource with an explanation why I
changed data[] to a ByteArrayOutputStream

<snip>
I was trying to accomplish two things here:

1.
In the original file data[] was used for holding the data.There was a
getOuputStream method returning a dummy outputstream (because it probably
couldn't get linked up to the data[]) whereas it should have returned a
stream to which you can write (to). Furthermore after parsing the
InputStream the Ouptutstream used  was being converted to a byte[]. By
replacing data[] with an outputstream these issues were solved/simplified.

2.
In order to reuse code (I like writing things only once :-) ) I made a
private method which can be used whether you access the class via a byte[]
OR an InputStream.
</snip>

/Colin