com.h3c.of.lib

## Class OfPacketWriter

- java.lang.Object
- - com.h3c.util.pkt.PacketWriter
  - - com.h3c.of.lib.OfPacketWriter

-     public class OfPacketWriter
      extends PacketWriter

  Extends the functionality of `PacketWriter` to include the OpenFlow datatypes from `com.h3c.of.lib.dt`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `OfPacketWriter(ByteBuffer bb)` Constructs the packet write backed by the supplied byte buffer.
    `OfPacketWriter(int length)` Constructs a packet writer wrapping a newly allocated byte array.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `write(BufferId id)` Writes a buffer id (u32) to the buffer.
    `void` | `write(DataPathId dpid)` Writes a datapath id (u64) to the buffer.
    `void` | `write(GroupId id)` Writes a group id (u32) to the buffer.
    `void` | `write(MeterId id)` Writes a meter id (u32) to the buffer.
    `void` | `write(QueueId id)` Writes a queue id (u32) to the buffer.
    `void` | `write(TableId id)` Writes a table id (u8) to the buffer.
    `void` | `write(VId id)` Writes a virtual id (u16) to the buffer.

    - ### Methods inherited from class com.h3c.util.pkt.PacketWriter

      `array, setU16, setU32, toString, wi, writableBytes, write, write, write, write, write, write, write, write, writeByte, writeBytes, writeBytes, writeBytes, writeInt, writeLong, writeString, writeString, writeU16, writeU24, writeU32, writeU8, writeU8, writeZeros`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### OfPacketWriter

          public OfPacketWriter(ByteBuffer bb)

      Constructs the packet write backed by the supplied byte buffer.
      Parameters:
        `bb` - the backing byte buffer buffer

    - #### OfPacketWriter

          public OfPacketWriter(int length)

      Constructs a packet writer wrapping a newly allocated byte array. Note that the writer index starts at 0.
      Parameters:
        `length` - the length of the byte array to create

  - ### Method Detail

    - #### write

          public void write(GroupId id)

      Writes a group id (u32) to the buffer.
      Parameters:
        `id` - the group id to write

    - #### write

          public void write(BufferId id)

      Writes a buffer id (u32) to the buffer.
      Parameters:
        `id` - the buffer id to write

    - #### write

          public void write(QueueId id)

      Writes a queue id (u32) to the buffer.
      Parameters:
        `id` - the queue id to write

    - #### write

          public void write(MeterId id)

      Writes a meter id (u32) to the buffer.
      Parameters:
        `id` - the meter id to write

    - #### write

          public void write(TableId id)

      Writes a table id (u8) to the buffer.
      Parameters:
        `id` - the table id to write

    - #### write

          public void write(VId id)

      Writes a virtual id (u16) to the buffer.
      Parameters:
        `id` - the virtual id to write

    - #### write

          public void write(DataPathId dpid)

      Writes a datapath id (u64) to the buffer.
      Parameters:
        `dpid` - the datapath id to write

Copyright © 2014. All Rights Reserved.