Java Convert via ByteBuffer toBytes(final UUID uuid)

Here you can find the source of toBytes(final UUID uuid)

Description

to Bytes

License

Apache License

Declaration

private static byte[] toBytes(final UUID uuid) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.nio.ByteBuffer;
import java.util.UUID;

public class Main {
    private static byte[] toBytes(final UUID uuid) {
        return ByteBuffer.allocate(Integer.SIZE).putInt(uuid.hashCode()).array();
    }/*from   w w  w .  j a  v  a  2  s. c o  m*/
}

Related

  1. toBytes(BigDecimal number, int byteLength)
  2. toBytes(char[] ch)
  3. toBytes(char[] chars)
  4. toBytes(char[] string)
  5. toBytes(final float val)
  6. toBytes(InputStream input)
  7. toBytes(int value)
  8. toBytes(long l)
  9. toBytes(Number value)