[jira] Updated: (IO-137) Added method for getting InputStream from ByteArrayOutputStream & IOUtils avoiding unnecessary array allocation and copy

2008-01-09 Thread Niall Pemberton (JIRA)

 [ 
https://issues.apache.org/jira/browse/IO-137?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Niall Pemberton updated IO-137:
---

Fix Version/s: (was: 1.4)
   AFTER-1.4

> Added method for getting InputStream from ByteArrayOutputStream & IOUtils 
> avoiding unnecessary array allocation and copy
> 
>
> Key: IO-137
> URL: https://issues.apache.org/jira/browse/IO-137
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers, Utilities
>Affects Versions: 1.3.2
> Environment: Any OS with appropriate JVM
>Reporter: Nikunj Trivedi
> Fix For: AFTER-1.4
>
> Attachments: baos_to_inputstream.patch, baos_toIstream.patch
>
>
> Patch inclues following two methods and test cases for both.
> 1) New Method: ByteArrayOutputStream.toInputStream
> ByteArrayOutputStream exposes its byte buffers by toByteArray(), which 
> creates a fresh buffer and copy existing data to it.
> A new method toInputStream() available in patch returns the current contents 
> of baos, as an InputStream, avoiding unnecessary allocation and copying.
> 2) New Method: IOUtils.toFullyBufferedInputStream
> There are situations where the InputStream source is available and it has to 
> be passed to different modules for processing.
> It is needed to fetch the full contents of the InputStream in internal 
> buffer(IOUtils.toByteArray() ), convert this buffer to ByteArrayInputStream 
> and use that stream instead. But this is wasteful since toByteArray() 
> requires one fresh allocation and copy operation.
> New method copies InputStream to ByteArrayOutputStream and returns 
> baos.toInputStream(), avoiding unnecessary memory allocation and copy.
> Testcases are available in respective classes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (IO-137) Added method for getting InputStream from ByteArrayOutputStream & IOUtils avoiding unnecessary array allocation and copy

2007-12-06 Thread Nikunj Trivedi (JIRA)

 [ 
https://issues.apache.org/jira/browse/IO-137?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikunj Trivedi updated IO-137:
--

Attachment: baos_to_inputstream.patch

Attached baos_to_inputstream.patch. I just replaced local machine paths with 
relative paths.

Can anybody discuss/comment/commit on this?

> Added method for getting InputStream from ByteArrayOutputStream & IOUtils 
> avoiding unnecessary array allocation and copy
> 
>
> Key: IO-137
> URL: https://issues.apache.org/jira/browse/IO-137
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers, Utilities
>Affects Versions: 1.3.2
> Environment: Any OS with appropriate JVM
>Reporter: Nikunj Trivedi
> Fix For: 1.4
>
> Attachments: baos_to_inputstream.patch, baos_toIstream.patch
>
>
> Patch inclues following two methods and test cases for both.
> 1) New Method: ByteArrayOutputStream.toInputStream
> ByteArrayOutputStream exposes its byte buffers by toByteArray(), which 
> creates a fresh buffer and copy existing data to it.
> A new method toInputStream() available in patch returns the current contents 
> of baos, as an InputStream, avoiding unnecessary allocation and copying.
> 2) New Method: IOUtils.toFullyBufferedInputStream
> There are situations where the InputStream source is available and it has to 
> be passed to different modules for processing.
> It is needed to fetch the full contents of the InputStream in internal 
> buffer(IOUtils.toByteArray() ), convert this buffer to ByteArrayInputStream 
> and use that stream instead. But this is wasteful since toByteArray() 
> requires one fresh allocation and copy operation.
> New method copies InputStream to ByteArrayOutputStream and returns 
> baos.toInputStream(), avoiding unnecessary memory allocation and copy.
> Testcases are available in respective classes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (IO-137) Added method for getting InputStream from ByteArrayOutputStream & IOUtils avoiding unnecessary array allocation and copy

2007-12-05 Thread Niall Pemberton (JIRA)

 [ 
https://issues.apache.org/jira/browse/IO-137?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Niall Pemberton updated IO-137:
---

Fix Version/s: (was: AFTER-1.4)
   (was: 1.3.2)
Affects Version/s: (was: 1.4)
   (was: AFTER-1.4)

> Added method for getting InputStream from ByteArrayOutputStream & IOUtils 
> avoiding unnecessary array allocation and copy
> 
>
> Key: IO-137
> URL: https://issues.apache.org/jira/browse/IO-137
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers, Utilities
>Affects Versions: 1.3.2
> Environment: Any OS with appropriate JVM
>Reporter: Nikunj Trivedi
> Fix For: 1.4
>
> Attachments: baos_toIstream.patch
>
>
> Patch inclues following two methods and test cases for both.
> 1) New Method: ByteArrayOutputStream.toInputStream
> ByteArrayOutputStream exposes its byte buffers by toByteArray(), which 
> creates a fresh buffer and copy existing data to it.
> A new method toInputStream() available in patch returns the current contents 
> of baos, as an InputStream, avoiding unnecessary allocation and copying.
> 2) New Method: IOUtils.toFullyBufferedInputStream
> There are situations where the InputStream source is available and it has to 
> be passed to different modules for processing.
> It is needed to fetch the full contents of the InputStream in internal 
> buffer(IOUtils.toByteArray() ), convert this buffer to ByteArrayInputStream 
> and use that stream instead. But this is wasteful since toByteArray() 
> requires one fresh allocation and copy operation.
> New method copies InputStream to ByteArrayOutputStream and returns 
> baos.toInputStream(), avoiding unnecessary memory allocation and copy.
> Testcases are available in respective classes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (IO-137) Added method for getting InputStream from ByteArrayOutputStream & IOUtils avoiding unnecessary array allocation and copy

2007-11-26 Thread Nikunj Trivedi (JIRA)

 [ 
https://issues.apache.org/jira/browse/IO-137?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikunj Trivedi updated IO-137:
--

  Component/s: Utilities
Fix Version/s: 1.3.2
   AFTER-1.4
   1.4

> Added method for getting InputStream from ByteArrayOutputStream & IOUtils 
> avoiding unnecessary array allocation and copy
> 
>
> Key: IO-137
> URL: https://issues.apache.org/jira/browse/IO-137
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers, Utilities
>Affects Versions: 1.3.2, 1.4, AFTER-1.4
> Environment: Any OS with appropriate JVM
>Reporter: Nikunj Trivedi
> Fix For: 1.3.2, 1.4, AFTER-1.4
>
> Attachments: baos_toIstream.patch
>
>
> Patch inclues following two methods and test cases for both.
> 1) New Method: ByteArrayOutputStream.toInputStream
> ByteArrayOutputStream exposes its byte buffers by toByteArray(), which 
> creates a fresh buffer and copy existing data to it.
> A new method toInputStream() available in patch returns the current contents 
> of baos, as an InputStream, avoiding unnecessary allocation and copying.
> 2) New Method: IOUtils.toFullyBufferedInputStream
> There are situations where the InputStream source is available and it has to 
> be passed to different modules for processing.
> It is needed to fetch the full contents of the InputStream in internal 
> buffer(IOUtils.toByteArray() ), convert this buffer to ByteArrayInputStream 
> and use that stream instead. But this is wasteful since toByteArray() 
> requires one fresh allocation and copy operation.
> New method copies InputStream to ByteArrayOutputStream and returns 
> baos.toInputStream(), avoiding unnecessary memory allocation and copy.
> Testcases are available in respective classes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (IO-137) Added method for getting InputStream from ByteArrayOutputStream & IOUtils avoiding unnecessary array allocation and copy

2007-11-21 Thread Nikunj Trivedi (JIRA)

 [ 
https://issues.apache.org/jira/browse/IO-137?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikunj Trivedi updated IO-137:
--

Attachment: baos_toIstream.patch

Includes patch for
1) ByteArrayOutputStream.toInputStream()
2) IOUtils.toFullyBufferedInputStream(InputStream)
3) Testcases for both of above.

> Added method for getting InputStream from ByteArrayOutputStream & IOUtils 
> avoiding unnecessary array allocation and copy
> 
>
> Key: IO-137
> URL: https://issues.apache.org/jira/browse/IO-137
> Project: Commons IO
>  Issue Type: New Feature
>  Components: Streams/Writers
>Affects Versions: 1.3.2, 1.4, AFTER-1.4
> Environment: Any OS with appropriate JVM
>Reporter: Nikunj Trivedi
> Attachments: baos_toIstream.patch
>
>
> Patch inclues following two methods and test cases for both.
> 1) New Method: ByteArrayOutputStream.toInputStream
> ByteArrayOutputStream exposes its byte buffers by toByteArray(), which 
> creates a fresh buffer and copy existing data to it.
> A new method toInputStream() available in patch returns the current contents 
> of baos, as an InputStream, avoiding unnecessary allocation and copying.
> 2) New Method: IOUtils.toFullyBufferedInputStream
> There are situations where the InputStream source is available and it has to 
> be passed to different modules for processing.
> It is needed to fetch the full contents of the InputStream in internal 
> buffer(IOUtils.toByteArray() ), convert this buffer to ByteArrayInputStream 
> and use that stream instead. But this is wasteful since toByteArray() 
> requires one fresh allocation and copy operation.
> New method copies InputStream to ByteArrayOutputStream and returns 
> baos.toInputStream(), avoiding unnecessary memory allocation and copy.
> Testcases are available in respective classes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.