Sorry you keep bumping into problems with the code.
I’m not sure what’s happening but that limit comes from:
long bitsRemaining = (bufferSize * 8) - estimatedSize;
I haven’t drilled farther than that… but I guess estimatedSize is larger than buffer size. Which without looking deeper implies that something didn’t split when it should have.
But you know just glancing through this code, I see a couple of things that trouble me:
- bitsRemaining is never recalculated in the loop… which seems wrong to me but it may be there is a reason and I just didn’t leave a comment.
- probably harmless, but FrameState’s getHeaderBitSize() seems 64 bits too small.
I’m about to go to bed. Sorry you are having to debug my code for me. Hopefully it’s a net win in the long run. Thanks for doing the leg work.