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

jassimp.util.ByteArrayUtil Maven / Gradle / Ivy

The newest version!
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package jassimp.util;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.charset.Charset;

/**
 *
 * @author elect
 */
public class ByteArrayUtil {

//    public static int readInteger(byte[] bs, int offset) throws IOException {
//        return readByteBuffer(bs, offset, 4).getInt();
//    }
//
//    public static float readFloat(byte[] bs, int offset) throws IOException {
//        return readByteBuffer(bs, offset, 4).getFloat();
//    }
//
//    public static short readShort(byte[] bs, int offset) throws IOException {
//        return readByteBuffer(bs, offset, 2).getShort();
//    }
//
//    public static byte readByte(byte[] bs, int offset) throws IOException {
//        return readByteBuffer(bs, offset, 1).get();
//    }
//
//    public static ByteBuffer readByteBuffer(byte[] bs, int offset, int length) throws IOException {
//        ByteBuffer byteBuffer = ByteBuffer.wrap(bs, offset, length);
//        return byteBuffer.order(ByteOrder.nativeOrder());
//    }
//
//    public static String readString(byte[] bs, int offset, int length) throws IOException {
//        return new String(bs, offset, length, Charset.forName("UTF-8"));
//    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy