Conversation
| { | ||
| if (isUniversalBuffer || buffer.base instanceof byte[]) { | ||
| if (isUniversalBuffer || buffer.base != null) { | ||
| // We have nothing to do. Wait until the garbage-collector collects this array object |
There was a problem hiding this comment.
I think we should use hasArray instead of buffer.base != null here for future changes
| /** | ||
| * Wraps a ByteBuffer into a MessageBuffer. | ||
| * | ||
| * The new MessageBuffer will be backed by the given byte array. Modifications to the new MessageBuffer will cause the byte array to be modified and vice versa. |
There was a problem hiding this comment.
The new MessageBuffer will be backed by the given byte array, ...
Created MessageBuffer will be a reference to the given byte array, so modifications to ...
There was a problem hiding this comment.
well, I copied mof of the text from JavaDoc of ByteBuffer: https://docs.oracle.com/javase/7/docs/api/java/nio/ByteBuffer.html#wrap(byte[])
Refactor MessageBuffer instantiation and add more tests
|
@miniway Could you check the build failure of Travis? |
|
I think we need |
Add ByteBuffer constructor at MessageBufferU and MessageBufferBE
|
|
|
Another PR to fix the test failures at the Universal MessageBuffer #383 |
Fix test failures at universal MessageBuffer
|
Looks ready to merge 👍 |
|
I have a small fix to get correct benchmark number, #384 |
Remove side effect of unpacker benchmark
|
👍 |
|
Merged. Great improvement. |
original code: #377