Created
July 23, 2018 16:00
-
-
Save franz1981/e47ee7e6e29f872070020b1d28713c43 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface WritableBuffer | |
{ | |
void put(CharSequence chars); | |
} | |
/** | |
* Writable Buffer implementation based on a Netty ByteBuf | |
*/ | |
public class AmqpWritableBuffer implements WritableBuffer { | |
@Override | |
public void put(CharSequence chars) { | |
final int bytes = ByteBufUtil.utf8Bytes(chars); | |
ByteBufUtil.reserveAndWriteUtf8(nettyBuffer, chars, bytes); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment