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

skadistats.clarity.platform.buffer.CompatibleBuffer Maven / Gradle / Ivy

Go to download

Clarity is an open source replay parser for Dota 2, CSGO, CS2 and Deadlock written in Java.

There is a newer version: 3.1.1
Show newest version
package skadistats.clarity.platform.buffer;

import skadistats.clarity.io.Util;

public class CompatibleBuffer {

    private CompatibleBuffer() {
        // please instantiate a subclass
    }

    public static class B32 implements Buffer.B32 {

        private final int[] data;

        public B32(byte[] input) {
            this.data = new int[(input.length + 7)  >> 2];
            Util.byteCopy(input, 0, data, 0, input.length);
        }

        @Override
        public int get(int n) {
            return data[n];
        }

    }

    public static class B64 implements Buffer.B64 {

        private final long[] data;

        public B64(byte[] input) {
            this.data = new long[(input.length + 15)  >> 3];
            Util.byteCopy(input, 0, data, 0, input.length);
        }

        @Override
        public long get(int n) {
            return data[n];
        }

    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy