[ 
https://issues.apache.org/jira/browse/DERBY-3936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12645792#action_12645792
 ] 

Knut Anders Hatlen commented on DERBY-3936:
-------------------------------------------

Having default values of false and adding the methods sounds fine to me. I think
  new Builder().bufferable(true).positionAware(true).dataOffset(100).build()
may be easier to read than
  new Builder(true, true).dataOffset(100).build()

As to the position issue, since the class is in iapi.jdbc I guess it makes some 
sense to follow the JDBC convention of saying that the first character is at 
position 1. If it turns out that it makes the calculations more complex, it can 
always be changed later.

> Add CharacterStreamDescriptor
> -----------------------------
>
>                 Key: DERBY-3936
>                 URL: https://issues.apache.org/jira/browse/DERBY-3936
>             Project: Derby
>          Issue Type: Sub-task
>          Components: JDBC
>    Affects Versions: 10.5.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-3936-1a-CharacterStreamDescriptor.diff
>
>
> A set of state information is required about byte streams representing 
> characters to be able to handle them properly.
> The basic pieces of information are:
>  - is bufferable
>  - is position aware
>  - data offset
>  - current byte position
>  - current char position
>  - byte length
>  - char length
> Additional info:
>  - encoding
>  - max allowed length
>  - bytes per char information
> The information is chosen with UTF8Reader in mind, and the plan is to pass a 
> CharacterStreamDescriptor instance to the constructor to allow the reader to 
> configure itself appropriately. The information is expected to be valid only 
> at a specific point in time, as some of it will change as soon as the reader 
> starts working with the underlying stream.

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

Reply via email to