Java ByteBuffer Set parseToByteBuffer(Object value)

Here you can find the source of parseToByteBuffer(Object value)

Description

parse To Byte Buffer

License

Open Source License

Declaration

public static ByteBuffer parseToByteBuffer(Object value) 

Method Source Code

//package com.java2s;
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt

import java.nio.ByteBuffer;

public class Main {
    public static ByteBuffer parseToByteBuffer(Object value) {
        if (value == null) {
            return null;
        }/*w w w .ja  va  2s. c  o m*/
        if (value instanceof ByteBuffer) {
            return (ByteBuffer) value;
        } else {
            return ByteBuffer.wrap(value.toString().getBytes());
        }
    }
}

Related

  1. hash_murmur3_128(ByteBuffer buf, int offset, int size, int i, byte[] result)
  2. isFree(int frameIx, int offset, ByteBuffer[] frames)
  3. macAddressToString(ByteBuffer packet, int offset, boolean needHyphen)
  4. memset(ByteBuffer dstBuffer, int dstByteOffset, byte value, int length)
  5. parseContent(ByteBuffer buffer, int offset, int length)
  6. pourBufferToArray(ByteBuffer source, byte[] destination, int offset, int sizeRequested)
  7. readBitset(ByteBuffer bb, int numbytes)
  8. readBitSet(ByteBuffer buf, int len)
  9. readBlock(ByteBuffer buffer, String fileName, long startOffset, Logger log)