Java : Best way to pass int by reference

后端 未结 7 2223
不知归路
不知归路 2020-11-28 05:36

I have a parsing function that parses an encoded length from a byte buffer, it returns the parsed length as an int, and takes an index into the buffer as an integer arg. I

7条回答
  •  暖寄归人
    2020-11-28 06:07

    You can try using org.apache.commons.lang.mutable.MutableInt from Apache Commons library. There is no direct way of doing this in the language itself.

提交回复
热议问题