public static StringBuilder toCamelCase(String name)
    {
        StringBuilder buffer = new StringBuilder();
        int toUpper = 0;
        char c;
        for (int i = 0, len = name.length(); i < len;)
        {
            c = name.charAt(i++);
            if (c == '_')
            {
                if (i == len)
                    break;
                if (buffer.length() != 0)
                    toUpper++;
                continue;
            }
            else if (toUpper != 0)
            {
                if (c > 96 && c < 123)
                {
                    buffer.append((char) (c - 32));
                    toUpper = 0;
                }
                else if (c > 64 && c < 91)
                {
                    buffer.append(c);
                    toUpper = 0;
                }
                else
                {
                    while (toUpper > 0)
                    {
                        buffer.append('_');
                        toUpper--;
                    }
                    buffer.append(c);
                }
            }
            else
            {
                if (buffer.length() == 0 && c > 64 && c < 91)
                    buffer.append((char) (c + 32));
                else
                    buffer.append(c);
            }
        }
        return buffer;
    }
Loads the proto from a {@link Reader}.
protostuff-parser/src/main/java/io/protostuff/parser/ProtoUtil.java