use of com.couchbase.client.core.deps.io.netty.buffer.ByteBufUtil in project couchbase-jvm-clients by couchbase.
the class GetCollectionManifestRequest method decode.
@Override
public GetCollectionManifestResponse decode(final ByteBuf response, final KeyValueChannelContext ctx) {
ResponseStatus status = MemcacheProtocol.decodeStatus(response);
Optional<String> manifest = Optional.empty();
if (status.success()) {
manifest = Optional.of(body(response).map(ByteBufUtil::getBytes).orElse(Bytes.EMPTY_BYTE_ARRAY)).map(b -> new String(b, StandardCharsets.UTF_8));
}
return new GetCollectionManifestResponse(status, manifest);
}
Aggregations