Hi,

I think I have found bug code in
org.apache.giraph.utils.UnsafeByteArrayOutputStream.

Let's see method *writeChars(String s)*

public void writeChars(String s) throws IOException {
>     // Note that this code is mostly copied from DataOutputStream
>     int len = s.length();
>     ensureSize(len);
>     for (int i = 0; i < len; i++) {
>       int v = s.charAt(i);
>       buf[pos++] = (byte) ((v >>> 8) & 0xFF);
>       buf[pos++] = (byte) ((v >>> 0) & 0xFF);
>     }
> }
>

The method *ensureSize* is called with an argument *len*, although in
*buf*added
*2 * len* bytes.

Am i right?


.''`.  With best regards,
: :' : Alexander Anisimov
`. `'  JID [email protected]
  `-   Debian - when you have better things to do than fixing systems

Reply via email to