[ 
https://issues.apache.org/jira/browse/LUCENE-2084?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12794706#action_12794706
 ] 

Uwe Schindler commented on LUCENE-2084:
---------------------------------------

OK.

I do not want to discuss further, the correct way for both directions according 
to NIO would be:

{code}
final int inputOffset = input.arrayOffset() + input.position();
final int inputLength = input.remaining();
final int outputOffset = output.arrayOffset() + output.position();
final int outputLength = getEncodedLength(input.array(), inputOffset, 
inputLength);
output.limit(outputLength + output.position());
//bogus: output.position(0);
{code}

The same the other way round (only with getEncodedLength()).

If we want to fix this, put this into the new issue. But as the methods are 
deprecated, with the big warning we do not need to fix it.

> remove Byte/CharBuffer wrapping for collation key generation
> ------------------------------------------------------------
>
>                 Key: LUCENE-2084
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2084
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: contrib/*
>            Reporter: Robert Muir
>            Assignee: Robert Muir
>            Priority: Minor
>             Fix For: 3.1
>
>         Attachments: collation.benchmark.tar.bz2, LUCENE-2084.patch, 
> LUCENE-2084.patch, LUCENE-2084.patch, LUCENE-2084.patch, 
> TopTFWikipediaWords.tar.bz2
>
>
> We can remove the overhead of ByteBuffer and CharBuffer wrapping in 
> CollationKeyFilter and ICUCollationKeyFilter.
> this patch moves the logic in IndexableBinaryStringTools into char[],int,int 
> and byte[],int,int based methods, with the previous Byte/CharBuffer methods 
> delegating to these.
> Previously, the Byte/CharBuffer methods required a backing array anyway.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-dev-h...@lucene.apache.org

Reply via email to