ByteBuf content = resource.content();
int contentLen = content.readableBytes();
buf.writeShort(contentLen);
buf.writeBytes(content, content.readerIndex(), contentLen);
}
private static void encodeName(String name, Charset charset, ByteBuf buf) {
String[] parts = StringUtil.split(name, '.');
for (String part: parts) {