On Aug 23, 2008, at 7:54 AM, Wang Ning wrote: > Hi Vincent, > > I think OutputStream convert(InputStream inputStream, > OfficeDocumentType inputDocumentType, OfficeDocumentType > outputDocumentType) is not appropriate. > The OutputStream is a place to write data to. I just can't get the > data from the OutputStream.
But why would you want to get data from it! You should only write to it inside convert() :) It's the user of it who may want to get the data and this is easy since he just have to use a StringBuffer/String as the underlying storage mechanism. So yes it definitely seem the correct way to do it. Thanks -Vincent > > I think the OutputStream should be a special outputStream the user > provide, so I have these to proposals for this interface: > 1. ByteArrayOutputStream convert(InputStream inputStream, > OfficeDocumentType inputDocumentType, OfficeDocumentType > outputDocumentType) > return type change to ByteArrayOutputStream. Then client can use > ByteArrayOutputStream.toByteArray() to get the contents in > OutputStream. > > 2. void convert(InputStream inputStream, OfficeDocumentType > inputDocumentType, OutputStream outputStream, OfficeDocumentType > outputDocumentType) > Client provide a output Target to store the contents. Example: > ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); > convert(inputStream, inputDocumentType, outputStream, > outputDocumentType) > > WDYT? > -- > Thanks > Wang Ning > _______________________________________________ > devs mailing list > [email protected] > http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs

