java.lang.Object
net.i2p.client.streaming.impl.PcapWriter.Options
Enclosing class:
PcapWriter

private static class PcapWriter.Optionsextends Object
Builder for TCP option blocks in the pcap output.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final byte[]
    Buffer holding the options read.
    private int
    Valid length of the options buffer.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Reads the options of one packet.
  • Method Summary

    All Methods
    Modifier and Type
    Method
    Description
    void
    add(byte type)
    Add a zero-data option.
    void
    add(byte type, int datalen, int data)
    Add an option with integer data.
    byte[]
    Returns the raw option data buffer (40 bytes long).
    int
    Returns the actual option length, rounded up to the next 4-byte boundary.

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • _b

      private final byte[] _b
      Buffer holding the options read.
    • _len

      private int _len
      Valid length of the options buffer.
  • Constructor Details

    • Options

      public Options()
      Reads the options of one packet.
  • Method Details

    • getData

      public byte[] getData()
      Returns the raw option data buffer (40 bytes long). The caller must use size() to get the actual used length.
      Returns:
      the option data buffer
    • size

      public int size()
      Returns the actual option length, rounded up to the next 4-byte boundary.
      Returns:
      the padded option length in bytes
    • add

      public void add(byte type)
      Add a zero-data option.
      Parameters:
      type - the option type byte
    • add

      public void add(byte type, int datalen, int data)
      Add an option with integer data.
      Parameters:
      type - the option type byte
      datalen - the length of the data in bytes
      data - the option data value