Java Utililty Methods ByteBuffer from Object

List of utility methods to do ByteBuffer from Object

Description

The list of methods to do ByteBuffer from Object are organized into topic(s).

Method

ByteBufferobjectToByteBuffer(Object object)
object To Byte Buffer
ByteBuffer byteBuf = null;
byteBuf = ByteBuffer.wrap(serializer(object));
byteBuf.rewind();
return byteBuf;
ByteBufferobjectToByteBuffer(Object target)
object To Byte Buffer
return ByteBuffer.wrap(objectToByte(target));
ByteBuffertoByteBuffer(Object val)
to Byte Buffer
ByteBuffer buffer = null;
try {
    if (val instanceof Byte) {
        buffer = ByteBuffer.allocate(Byte.SIZE);
        buffer.put(0, (Byte) val);
        return buffer;
    if (val instanceof byte[])
...
ByteBuffertoByteBuffer(Serializable serializable)
to Byte Buffer
try {
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    new ObjectOutputStream(outputStream).writeObject(serializable);
    return ByteBuffer.wrap(outputStream.toByteArray());
} catch (IOException e) {
    throw new RuntimeException(e);