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

org.pixel.commons.util.TextUtils Maven / Gradle / Ivy

The newest version!
/*
 * This software is available under Apache License
 * Copyright (c) 2020
 */

package org.pixel.commons.util;

import java.nio.ByteBuffer;

public class TextUtils {

    /**
     * Convert bytebuffer to string
     *
     * @param buffer
     * @return
     */
    public static String convertToString(ByteBuffer buffer) {
        byte[] array = new byte[buffer.limit()];
        buffer.get(array, 0, buffer.limit());
        return new String(array);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy