Example usage for io.netty.buffer ByteBufUtil copy

List of usage examples for io.netty.buffer ByteBufUtil copy

Introduction

In this page you can find the example usage for io.netty.buffer ByteBufUtil copy.

Prototype

public static void copy(AsciiString src, int srcIdx, ByteBuf dst, int dstIdx, int length) 

Source Link

Document

Copies the content of src to a ByteBuf using ByteBuf#setBytes(int,byte[],int,int) .

Usage

From source file:com.linecorp.armeria.server.grpc.ArmeriaServerCall.java

License:Apache License

private static void writeAscii(ByteBuf buf, int offset, CharSequence value, int valueLen) {
    if (value instanceof AsciiString) {
        ByteBufUtil.copy((AsciiString) value, 0, buf, offset, valueLen);
    } else {/* w  w w .ja v  a 2s . co m*/
        writeCharSequence(buf, offset, value, valueLen);
    }
}