com.mchange.v3.nio.ByteBufferUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of guiced-persistence-c3p0 Show documentation
Show all versions of guiced-persistence-c3p0 Show documentation
Enables C3P0 with Hibernate connections in the GuicedPersistence provider
Requires JDK 8 and up
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 - 2025 Weber Informatics LLC | Privacy Policy