@Override
    public int hashCode()
    {
        int h = hash;

        if (h == 0)
        {
            final byte[] thisBytes = bytes;
            final int size = bytes.length;

            h = size;
            for (int i = 0; i < size; i++)
            {
                h = h * 31 + thisBytes[i];
            }
            if (h == 0)
            {
                h = 1;
            }

            hash = h;
        }

        return h;
    }
Returns true if the contents of the internal array and the provided array match.
protostuff-api/src/main/java/io/protostuff/ByteString.java