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

org.zodiac.sdk.nio.channeling.ChannelingBytes Maven / Gradle / Ivy

There is a newer version: 1.6.8
Show newest version
package org.zodiac.sdk.nio.channeling;


import java.util.Arrays;

public class ChannelingBytes {

    private byte[] buff;
    private int offset, length;
    public ChannelingBytes(){}
    public ChannelingBytes(byte[] buff, int offset, int length) {
        this.buff = buff;
        this.offset = offset;
        this.length = length;
    }

    public byte[] getBuff() {
        return buff;
    }

    public void setBuff(byte[] buff) {
        this.buff = buff;
    }

    public int getOffset() {
        return offset;
    }

    public int getLength() {
        return length;
    }

    public void setOffset(int offset) {
        this.offset = offset;
    }

    public void setLength(int length) {
        this.length = length;
    }

    public byte[] toByteArray() {
       return Arrays.copyOfRange(buff, offset, offset + length);
    }

    @Override
    public String toString() {
       return new String(buff, offset, length);
    }
}







© 2015 - 2024 Weber Informatics LLC | Privacy Policy