We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello
Here is the getByte function
getByte
private def getByte(start: Long, bits: Int, signed: Boolean): Byte = { require(sizeGreaterThanOrEqual(start + bits) && bits >= 0 && bits <= 8) var result = 0x0ff & getByte(0) if (bits != 0) result = result >>> (8 - bits) // Sign extend if necessary if (signed && bits != 8 && ((1 << (bits - 1)) & result) != 0) { val toShift = 32 - bits result = (result << toShift) >> toShift } result.toByte }
One can see that on the 3rd line it calls getByte(n: Long) which in turn looks up the underlying, but, it calls it with 0; not the start byte.
getByte(n: Long)
0
start
The text was updated successfully, but these errors were encountered:
4a467cf
Merge pull request #106 from scodec/bugfix/105
56bd1f4
Fixed #105 - bug in sliceToByte
No branches or pull requests
Hello
Here is the
getByte
functionOne can see that on the 3rd line it calls
getByte(n: Long)
which in turn looks up the underlying, but, it calls it with0
; not thestart
byte.The text was updated successfully, but these errors were encountered: