[ 
https://issues.apache.org/jira/browse/DAFFODIL-1748?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16900037#comment-16900037
 ] 

Steve Lawrence edited comment on DAFFODIL-1748 at 8/5/19 12:07 PM:
-------------------------------------------------------------------

Note that 3 places in the non-deprecated API still use channels:

{code:scala}
def reload(savedParser: ReadableByteChannel): DataProcessor
def save(output: WritableByteChannel): Unit
def unparse(input: InfosetInputter, output: WritableByteChannel): UnparseResult
{code}

Not sure if save/reload are super important to be changed. But the parse method 
uses an InputSourceDataInputStream, which acts on InputStream, ByteBuffer, and 
Array[Byte]--it might make sense for unparse to mimick this and work on those 
as well, or at least on an OutputStream if we want to keep the API simple. Or 
perhaps we want something like an OutputSourceDataOutputStream to mimick parse, 
and that wraps different output methods.


was (Author: slawrence):
Note that 3 places in the non-deprecated API still use channels:
``` scala
def reload(savedParser: ReadableByteChannel): DataProcessor
def save(output: WritableByteChannel): Unit
def unparse(input: InfosetInputter, output: WritableByteChannel): UnparseResult
```
Not sure if save/reload are super important to be changed. But the parse method 
uses an InputSourceDataInputStream, which acts on InputStream, ByteBuffer, and 
Array[Byte]--it might make sense for unparse to mimick this and work on those 
as well, or at least on an OutputStream if we want to keep the API simple. Or 
perhaps we want something like an OutputSourceDataOutputStream to mimick parse, 
and that wraps different output methods.

> Investigate use of java.nio.channels
> ------------------------------------
>
>                 Key: DAFFODIL-1748
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-1748
>             Project: Daffodil
>          Issue Type: Improvement
>          Components: API
>            Reporter: Steve Lawrence
>            Priority: Major
>
> We should investigate the use of java.nio.channels in our API. It's possible 
> that the use of standard java.io may have better performance than the use 
> java.nio. Need to investigate and determine if it makes sense to switch.
> Should be done as part of 2.0.0 since this would break the Daffodil API.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to