[ 
http://issues.apache.org/jira/browse/DIRMINA-165?page=comments#action_12363224 
] 

Niklas Therning commented on DIRMINA-165:
-----------------------------------------

I've already implemented slice() but haven't committed it yet. I've also added 
a slice(offset, length) method which uses the passed in values instead of the 
current postion and limit. I think it will be quite useful. I haven't thought 
of checking pooled == false. I will have to add that before committing.

slice() becomes:

public ByteBuffer slice()
{
  assertNotPooled(); // Throws IllegalStateException if pooled == true
  return wrap( buf().slice() );
}

Does this look OK? If it does the rest of the methods (duplicate(), 
asReadOnlyBuffer()) could be implemented like this.


> Easy and performant copy of the ByteBuffer
> ------------------------------------------
>
>          Key: DIRMINA-165
>          URL: http://issues.apache.org/jira/browse/DIRMINA-165
>      Project: Directory MINA
>         Type: Improvement
>     Versions: 0.9, 0.8.2, 0.8.1, 0.8
>     Reporter: Federico Bonelli
>     Priority: Minor
>  Attachments: ByteBuffer.java, HubServer_broadCastTCPmessages.zip
>
> Until now if you wish to broadcast a message you must create by your own the 
> bytebuffer copies, it would be better to provide a ByteBuffer.asReadOnly() 
> method that create a copy that share the data with the original ByteBuffer

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to