You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Andrzej Bialecki (JIRA)" <ji...@apache.org> on 2006/06/21 22:14:32 UTC
[jira] Commented: (HADOOP-310) Additional constructor requested in
BytesWritable
[ http://issues.apache.org/jira/browse/HADOOP-310?page=comments#action_12417172 ]
Andrzej Bialecki commented on HADOOP-310:
------------------------------------------
Perhaps a more general constructor, similar to the ones used in many other places, would be better:
/**
* Create a BytesWritable using a part of the byte array as the initial value.
*/
public BytesWritable(byte[] bytes, int offset, int length) {
....
}
This way it would satisfy your requirement, and perhaps help to avoid many other cases of copying ...
> Additional constructor requested in BytesWritable
> -------------------------------------------------
>
> Key: HADOOP-310
> URL: http://issues.apache.org/jira/browse/HADOOP-310
> Project: Hadoop
> Type: Improvement
> Components: io
> Reporter: paul sutter
> Priority: Minor
>
> It would be grand if BytesWritable.java had an additional constructor as below. This allows me to use the BytesWritable class without doing a buffer copy, since we have a less-than-fully-utilized byte array holding our key.
> Thanks!
>
> /**
> * Create a BytesWritable using the byte array as the initial value.
> * @param bytes This array becomes the backing storage for the object.
> */
> public BytesWritable(byte[] bytes, int size) {
> this.bytes = bytes;
> this.size = size;
> }
>
--
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