Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add dynamically extensible underlying buffer support #62

Open
RReverser opened this Issue · 3 comments

2 participants

Ingvar Stepanyan peterseverin
Ingvar Stepanyan
Owner

Allow new jDataView() with no arguments for creating jDataView on dynamically extensible empty buffer.

peterseverin

Is there a workaround for this issue? I'm trying to implement a binary serialization where the final buffer size is not known in advance. I would expect to have the possibility to grow the buffer as needed.

Ingvar Stepanyan
Owner

@peterseverin For now, in own projects I had to use fixed-size buffer with calculated size big enough to hold my data. The problem is that all the existing implementations (except old generic Array) don't support dynamic extension, so this needs to be solved on jDataView size with either "ropes" mechanism (where one instance can continue other) or copy-on-extend.

Since it's needed not just for me, I'll try to get back to it soon, but if you could implement it and send PR, I'd appreciate that.

peterseverin

@RReverser I think copy on extend would be an acceptable solution. This is a common solution in Java when using arrays. I'll try to add something simple in _checkBounds method but a good solution would probably need a more systematic approach, probably in _setBytes method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.