2 * Copyright (c) 2013 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.pcep.impl.subobject;
10 import io.netty.buffer.ByteBuf;
11 import org.opendaylight.protocol.pcep.spi.AbstractEROPathKeySubobjectParser;
12 import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
13 import org.opendaylight.protocol.util.ByteArray;
15 public final class EROPathKey128SubobjectParser extends AbstractEROPathKeySubobjectParser {
18 protected byte[] readPceId(final ByteBuf buffer) {
19 return ByteArray.readBytes(buffer, PCE128_ID_F_LENGTH);
23 protected void checkContentLenght(final int lenght) throws PCEPDeserializerException {
24 if (lenght != CONTENT128_LENGTH) {
25 throw new PCEPDeserializerException("Wrong length of array of bytes. Passed: " + lenght + "; Expected: >"
26 + CONTENT128_LENGTH + ".");