Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
expose method to create parser from direct memory #435
Conversation
|
@komamitsu Could you review this change? This seems a good improvement. |
|
@arnaudroger Thanks for the contribution! It seems a cool feature. But I have some questions. Can I ask you to take a look at them? |
| * @param address the address | ||
| * @param offset the offset | ||
| * @param length the length | ||
| * @return a new ByteBufferInput on the specified address |
komamitsu
Oct 21, 2017
Member
This static method returns ByteBuffer not ByteBufferInput
This static method returns ByteBuffer not ByteBufferInput
| */ | ||
| public static ByteBuffer directBuffer(long address, int offset, int length) | ||
| { | ||
| return DirectBufferAccess.newByteBuffer(address, offset, length, null); |
komamitsu
Oct 21, 2017
Member
It doesn't seem to me that this method is related to ByteBufferInput.
@xerial Do you think this is the right place to put the method in?
It doesn't seem to me that this method is related to ByteBufferInput.
@xerial Do you think this is the right place to put the method in?
xerial
Nov 29, 2017
Member
We can make DirectBufferAccess a public class instead of adding this method.
We can make DirectBufferAccess a public class instead of adding this method.
xerial
Nov 29, 2017
Member
Actually this location is a bit weird.
Actually this location is a bit weird.
| return _createParser(data, offset, length, ioContext); | ||
| } | ||
|
|
||
| public JsonParser createParser(long memoryAddress, int offset, int length) |
komamitsu
Oct 21, 2017
Member
As you might notice since this method doesn't have @Override annotation, Jackson doesn't support this kind of API, I think.
How do you use this method via Jackson's API? It would be great, if you add some unit tests to make it clear 😺
As you might notice since this method doesn't have @Override annotation, Jackson doesn't support this kind of API, I think.
How do you use this method via Jackson's API? It would be great, if you add some unit tests to make it clear
arnaudroger
Oct 21, 2017
Author
I use the MessagePackFactory directly, currently using reflection.
I use the MessagePackFactory directly, currently using reflection.
Useful to parse message coming in from netty for example without creating a lot of garbage.
Also expose the method to create a parser from a sub array.