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

com.mchange.v3.nio.ByteBufferUtils Maven / Gradle / Ivy

There is a newer version: 0.2.20_1
Show newest version
package com.mchange.v3.nio;

import java.nio.ByteBuffer;

public final class ByteBufferUtils
{
    public static byte[] newArray( ByteBuffer bb )
    {
	if ( bb.hasArray() ) {
	    return (byte[]) bb.array().clone();
	} else {
	    byte[] out = new byte[bb.remaining()];
	    bb.get(out);
	    return out;
	}
    }

    private ByteBufferUtils()
    {}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy