List of usage examples for java.lang Long SIZE
int SIZE
To view the source code for java.lang Long SIZE.
Click Source Link
From source file:info.gehrels.flockDBClient.ByteHelper.java
static ByteBuffer asByteBufferOrNull(long... destinationIds) { ByteBuffer buf = null;//from ww w . j a v a 2s . c o m if (isNotEmpty(destinationIds)) { buf = ByteBuffer.wrap(new byte[destinationIds.length * (Long.SIZE / 8)]); buf.order(ByteOrder.LITTLE_ENDIAN); for (long destinationId : destinationIds) { buf.putLong(destinationId); } buf.rewind(); } return buf; }
From source file:info.gehrels.flockDBClient.ByteHelper.java
static ByteBuffer asByteBuffer(long... destinationIds) { ByteBuffer buf = null;/*from www.ja v a 2 s. c o m*/ buf = ByteBuffer.wrap(new byte[destinationIds.length * (Long.SIZE / 8)]); buf.order(ByteOrder.LITTLE_ENDIAN); for (long destinationId : destinationIds) { buf.putLong(destinationId); } buf.rewind(); return buf; }
From source file:org.sinekartads.util.HexUtils.java
public static String encodeHex(long value) { long tmpL = value; int bytes = 0; while (bytes < Long.SIZE && tmpL > 0) { tmpL = tmpL >> 8;//from ww w . j a va 2s . c o m bytes++; } return encodeHex(value, bytes); }
From source file:com.moscona.dataSpace.Text.java
@Override public long sizeInBytes() { return (long) Long.SIZE / 8 * 2; // reference to string plus the object itself }
From source file:com.moscona.dataSpace.FactorValue.java
@Override public long sizeInBytes() { return Long.SIZE / 4; // very rough estimate, but good enough as we do not make vectors directly out of these }
From source file:com.openteach.diamond.network.waverider.command.Command.java
/** * /*from ww w . j a v a 2s . c o m*/ * @return */ public static int getHeaderSize() { int size = 0; size += Long.SIZE / Byte.SIZE; size += Integer.SIZE / Byte.SIZE; return size; }
From source file:com.openteach.diamond.network.waverider.network.Packet.java
/** * /*from www . jav a 2 s . co m*/ * @return */ public static int getHeaderSize() { int size = 0; size += NetWorkConstants.WAVERIDER_MAGIC.getBytes().length; size += Long.SIZE / Byte.SIZE; size += Long.SIZE / Byte.SIZE; size += Integer.SIZE / Byte.SIZE; return size; }
From source file:com.bah.culvert.util.Bytes.java
/** * Convert the long to a byte []/*from w w w . j a v a 2 s . c o m*/ * @param i * @return */ public static byte[] toBytes(long i) { int bytes = Long.SIZE / 8; return ByteBuffer.allocate(bytes).putLong(i).array(); }
From source file:com.moscona.dataSpace.Numeric.java
@Override public long sizeInBytes() { if (value == null) { return 2L; }// www .j a va 2 s. c om if (value.getClass() == Double.class) { return 2L + Double.SIZE / 8; } if (value.getClass() == Float.class) { return 2L + Float.SIZE / 8; } if (value.getClass() == Long.class) { return 2L + Long.SIZE / 8; } if (value.getClass() == Integer.class) { return 2L + Integer.SIZE / 8; } if (value.getClass() == Short.class) { return 2L + Short.SIZE / 8; } if (value.getClass() == Byte.class) { return 2L + Byte.SIZE / 8; } return 2L; }
From source file:com.openteach.diamond.network.waverider.network.Packet.java
/** * ??//from w w w .j a v a 2 s . co m * @return */ public static int getLengthPosition() { int size = 0; size += NetWorkConstants.WAVERIDER_MAGIC.getBytes().length; size += Long.SIZE / Byte.SIZE; size += Long.SIZE / Byte.SIZE; return size; }