3 ms·
I found a use for the overriding field access once, when there was a large data structure bit-packed into a byte array. I didn't really need to convert it to a
by deepsun 3y ago
I found a use for the overriding field access once, when there was a large data structure bit-packed into a byte array. I didn't really need to convert it to a different data structure, but to just extract some values, and pack it back to the byte array.
So I overrode the field access that operated directly on the byte array.
PS: It was in Kotlin, using @get/@set, but it doesn't matter for the philosophy.