forked from TrueCloudLab/frostfs-sdk-java
[#1] provide naming conventions
Signed-off-by: Ori Bruk <o.bruk@yadro.com>
This commit is contained in:
parent
a7fab6f314
commit
bf2f19f08d
103 changed files with 416 additions and 417 deletions
|
@ -1,21 +0,0 @@
|
|||
package info.FrostFS.sdk;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.UUID;
|
||||
|
||||
public class UUIDExtension {
|
||||
|
||||
public static UUID asUuid(byte[] bytes) {
|
||||
ByteBuffer bb = ByteBuffer.wrap(bytes);
|
||||
long firstLong = bb.getLong();
|
||||
long secondLong = bb.getLong();
|
||||
return new UUID(firstLong, secondLong);
|
||||
}
|
||||
|
||||
public static byte[] asBytes(UUID id) {
|
||||
ByteBuffer bb = ByteBuffer.allocate(16);
|
||||
bb.putLong(id.getMostSignificantBits());
|
||||
bb.putLong(id.getLeastSignificantBits());
|
||||
return bb.array();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue