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

cn.nukkit.utils.collection.PureByteArray Maven / Gradle / Ivy

package cn.nukkit.utils.collection;

import org.jetbrains.annotations.NotNull;

public final class PureByteArray implements ByteArrayWrapper {
    private byte[] data;

    PureByteArray(@NotNull byte[] src) {
        this.data = src;
    }

    PureByteArray(int length) {
        this.data = new byte[length];
    }

    @Override
    public byte[] getRawBytes() {
        return data;
    }

    @Override
    public void setRawBytes(byte[] bytes) {
        this.data = bytes;
    }

    @Override
    public byte getByte(int index) {
        return data[index];
    }

    @Override
    public void setByte(int index, byte b) {
        data[index] = b;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy