Example usage for io.netty.buffer ByteBuf skipBytes

List of usage examples for io.netty.buffer ByteBuf skipBytes

Introduction

In this page you can find the example usage for io.netty.buffer ByteBuf skipBytes.

Prototype

public abstract ByteBuf skipBytes(int length);

Source Link

Document

Increases the current readerIndex by the specified length in this buffer.

Usage

From source file:org.opendaylight.openflowjava.protocol.impl.deserialization.instruction.ApplyActionsInstructionDeserializer.java

License:Open Source License

@Override
public Instruction deserializeHeader(ByteBuf input) {
    InstructionBuilder builder = new InstructionBuilder();
    input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
    builder.setInstructionChoice(new ApplyActionsCaseBuilder().build());
    return builder.build();
}

From source file:org.opendaylight.openflowjava.protocol.impl.deserialization.instruction.ClearActionsInstructionDeserializer.java

License:Open Source License

@Override
public Instruction deserialize(ByteBuf input) {
    InstructionBuilder builder = new InstructionBuilder();
    input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
    input.skipBytes(InstructionConstants.PADDING_IN_ACTIONS_INSTRUCTION);
    builder.setInstructionChoice(new ClearActionsCaseBuilder().build());
    return builder.build();
}

From source file:org.opendaylight.openflowjava.protocol.impl.deserialization.instruction.ClearActionsInstructionDeserializer.java

License:Open Source License

@Override
public Instruction deserializeHeader(ByteBuf input) {
    InstructionBuilder builder = new InstructionBuilder();
    input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
    builder.setInstructionChoice(new ClearActionsCaseBuilder().build());
    return builder.build();
}

From source file:org.opendaylight.openflowjava.protocol.impl.deserialization.instruction.GoToTableInstructionDeserializer.java

License:Open Source License

@Override
public Instruction deserialize(ByteBuf input) {
    InstructionBuilder builder = new InstructionBuilder();
    GotoTableCaseBuilder caseBuilder = new GotoTableCaseBuilder();
    GotoTableBuilder instructionBuilder = new GotoTableBuilder();
    input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
    instructionBuilder.setTableId(input.readUnsignedByte());
    caseBuilder.setGotoTable(instructionBuilder.build());
    builder.setInstructionChoice(caseBuilder.build());
    input.skipBytes(InstructionConstants.PADDING_IN_GOTO_TABLE);
    return builder.build();
}

From source file:org.opendaylight.openflowjava.protocol.impl.deserialization.instruction.GoToTableInstructionDeserializer.java

License:Open Source License

@Override
public Instruction deserializeHeader(ByteBuf input) {
    InstructionBuilder builder = new InstructionBuilder();
    input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
    builder.setInstructionChoice(new GotoTableCaseBuilder().build());
    return builder.build();
}

From source file:org.opendaylight.openflowjava.protocol.impl.deserialization.instruction.MeterInstructionDeserializer.java

License:Open Source License

@Override
public Instruction deserialize(ByteBuf input) {
    InstructionBuilder builder = new InstructionBuilder();
    input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
    MeterCaseBuilder caseBuilder = new MeterCaseBuilder();
    MeterBuilder instructionBuilder = new MeterBuilder();
    instructionBuilder.setMeterId(input.readUnsignedInt());
    caseBuilder.setMeter(instructionBuilder.build());
    builder.setInstructionChoice(caseBuilder.build());
    return builder.build();
}

From source file:org.opendaylight.openflowjava.protocol.impl.deserialization.instruction.MeterInstructionDeserializer.java

License:Open Source License

@Override
public Instruction deserializeHeader(ByteBuf input) {
    InstructionBuilder builder = new InstructionBuilder();
    input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
    builder.setInstructionChoice(new MeterCaseBuilder().build());
    return builder.build();
}

From source file:org.opendaylight.openflowjava.protocol.impl.deserialization.instruction.WriteActionsInstructionDeserializer.java

License:Open Source License

@Override
public Instruction deserialize(ByteBuf input) {
    InstructionBuilder builder = new InstructionBuilder();
    input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
    int instructionLength = input.readUnsignedShort();
    input.skipBytes(InstructionConstants.PADDING_IN_ACTIONS_INSTRUCTION);
    WriteActionsCaseBuilder caseBuilder = new WriteActionsCaseBuilder();
    WriteActionsBuilder actionsBuilder = new WriteActionsBuilder();
    actionsBuilder.setAction(deserializeActions(input, instructionLength));
    caseBuilder.setWriteActions(actionsBuilder.build());
    builder.setInstructionChoice(caseBuilder.build());
    return builder.build();
}

From source file:org.opendaylight.openflowjava.protocol.impl.deserialization.instruction.WriteActionsInstructionDeserializer.java

License:Open Source License

@Override
public Instruction deserializeHeader(ByteBuf input) {
    InstructionBuilder builder = new InstructionBuilder();
    input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
    builder.setInstructionChoice(new WriteActionsCaseBuilder().build());
    return builder.build();
}

From source file:org.opendaylight.openflowjava.protocol.impl.deserialization.instruction.WriteMetadataInstructionDeserializer.java

License:Open Source License

@Override
public Instruction deserialize(ByteBuf input) {
    InstructionBuilder builder = new InstructionBuilder();
    input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
    input.skipBytes(InstructionConstants.PADDING_IN_WRITE_METADATA);
    WriteMetadataCaseBuilder caseBuilder = new WriteMetadataCaseBuilder();
    WriteMetadataBuilder metadataBuilder = new WriteMetadataBuilder();
    byte[] metadata = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
    input.readBytes(metadata);/* w  w w.j  a v  a  2  s .c  om*/
    metadataBuilder.setMetadata(metadata);
    byte[] metadataMask = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
    input.readBytes(metadataMask);
    metadataBuilder.setMetadataMask(metadataMask);
    caseBuilder.setWriteMetadata(metadataBuilder.build());
    builder.setInstructionChoice(caseBuilder.build());
    return builder.build();
}