All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.pkts.packet.sip.header.impl.ContentLengthHeaderImpl Maven / Gradle / Ivy

There is a newer version: 3.0.10
Show newest version
package io.pkts.packet.sip.header.impl;

import io.pkts.buffer.Buffers;
import io.pkts.packet.sip.header.ContentLengthHeader;

public class ContentLengthHeaderImpl extends SipHeaderImpl implements ContentLengthHeader {

    private int length;

    public ContentLengthHeaderImpl(final int length) {
        super(ContentLengthHeader.NAME, Buffers.wrap(length));
        this.length = length;
    }

    @Override
    public int getContentLength() {
        return this.length;
    }

    @Override
    public ContentLengthHeader clone() {
        return new ContentLengthHeaderImpl(this.length);
    }

    @Override
    public ContentLengthHeader ensure() {
        return this;
    }

    @Override
    public ContentLengthHeader.Builder copy() {
        return new ContentLengthHeader.Builder(this.length);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy