com.playtika.shepherd.inernal.utils.BytesUtils Maven / Gradle / Ivy
package com.playtika.shepherd.inernal.utils;
import java.nio.ByteBuffer;
import java.util.Collection;
import java.util.List;
public class BytesUtils {
public static List toBytes(Collection bufs){
return bufs.stream().map(BytesUtils::toBytes).toList();
}
public static byte[] toBytes(ByteBuffer buf){
byte[] arr = new byte[buf.remaining()];
buf.get(arr);
buf.rewind();
return arr;
}
public static List toBuffs(Collection bites){
return bites.stream().map(ByteBuffer::wrap).toList();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy