Skip to content

Instantly share code, notes, and snippets.

@franz1981
Created July 23, 2018 16:00
Show Gist options
  • Save franz1981/e47ee7e6e29f872070020b1d28713c43 to your computer and use it in GitHub Desktop.
Save franz1981/e47ee7e6e29f872070020b1d28713c43 to your computer and use it in GitHub Desktop.
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