2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.protocol.util;
10 import io.netty.buffer.ByteBuf;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ieee754.rev130819.Float32;
14 * Utility class for ByteBuf's write methods.
16 public final class ByteBufWriteUtil {
17 private ByteBufWriteUtil() {
22 * Writes Float32 <code>value</code> if not null, otherwise writes zeros to
23 * the <code>output</code> ByteBuf. ByteBuf's writerIndex is increased by 4.
26 * Float32 value to be written to the output.
28 * ByteBuf, where value or zeros are written.
30 public static void writeFloat32(final Float32 value, final ByteBuf output) {
32 output.writeBytes(value.getValue());