13 Jun 2005 17:05
requesting addition to ByteCodec class
Jacques Belissent <jacques.belissent <at> sun.com>
2005-06-13 15:05:31 GMT
2005-06-13 15:05:31 GMT
Hi,
Minor knit. I would like to use the ByteCodec.encode method on a
sub-array. It would be good if an encode method taking offset and
length where present in the ByteCodec class. The alternative is to copy
the subarray to encode into a new array, which is not efficient.
Here are the diffs.
Index: org/jabberstudio/jso/util/ByteCodec.java
===================================================================
RCS file: /home/cvs/jso/src/org/jabberstudio/jso/util/ByteCodec.java,v
retrieving revision 1.5
diff -r1.5 ByteCodec.java
52a53,54
> * <at> param offset index of first array element to convert.
> * <at> param len number of bytes to convert
56c58
< public String encode(byte[] input) {
---
> public String encode(byte[] input, int offset, int len) {
61a64,67
>
> len += offset;
> if (len > input.length)
> len = input.length;
63c69
< for (idx = 0; idx < input.length; idx++) {
---
(Continue reading)
RSS Feed