/** * Given an array of bytes it will convert the bytes to a hex string * representation of the bytes. * * @param bytes * the bytes to convert in a hex string * @return hex string representation of the byte array */ public static String byteToHexString(final byte[] bytes) { return byteToHexString(bytes, 0, bytes.length); }
@Override public String toString() { return String.format("TestEvent %d (%s)", magicNumber, StringUtils.byteToHexString(payload)); } }
@Override public String toString() { if (this.toString == null) { final byte[] ba = new byte[SIZE]; longToByteArray(this.lowerPart, ba, 0); longToByteArray(this.upperPart, ba, SIZE_OF_LONG); this.toString = StringUtils.byteToHexString(ba); } return this.toString; }
/** * Creates a new buffer spiller, spilling to one of the I/O manager's temp directories. * * @param ioManager The I/O manager for access to the temp directories. * @param pageSize The page size used to re-create spilled buffers. * @throws IOException Thrown if the temp files for spilling cannot be initialized. */ public BufferSpiller(IOManager ioManager, int pageSize) throws IOException { this.pageSize = pageSize; this.readBuffer = ByteBuffer.allocateDirect(READ_BUFFER_SIZE); this.readBuffer.order(ByteOrder.LITTLE_ENDIAN); this.headBuffer = ByteBuffer.allocateDirect(16); this.headBuffer.order(ByteOrder.LITTLE_ENDIAN); File[] tempDirs = ioManager.getSpillingDirectories(); this.tempDir = tempDirs[DIRECTORY_INDEX.getAndIncrement() % tempDirs.length]; byte[] rndBytes = new byte[32]; ThreadLocalRandom.current().nextBytes(rndBytes); this.spillFilePrefix = StringUtils.byteToHexString(rndBytes) + '.'; // prepare for first contents createSpillingChannel(); }
@Test public void testHexArrayToString() { byte[] byteArray = new byte[]{1, -97, 49, 74 }; String hex = StringUtils.byteToHexString(byteArray); assertEquals("019f314a", hex); }
LOG.debug("Generated hash '" + byteToHexString(hash) + "' for node " + "'" + node.toString() + "' {id: " + node.getId() + ", " + "parallelism: " + node.getParallelism() + ", " +
/** * Given an array of bytes it will convert the bytes to a hex string * representation of the bytes. * * @param bytes * the bytes to convert in a hex string * @return hex string representation of the byte array */ public static String byteToHexString(final byte[] bytes) { return byteToHexString(bytes, 0, bytes.length); }
@Override public String toString() { return encodedReference == null ? "(default)" : StringUtils.byteToHexString(encodedReference, 0, encodedReference.length); }
@Override public String toString() { return encodedReference == null ? "(default)" : StringUtils.byteToHexString(encodedReference, 0, encodedReference.length); }
@Override public String toString() { return encodedReference == null ? "(default)" : StringUtils.byteToHexString(encodedReference, 0, encodedReference.length); }
private static String randomString(Random random) { final byte[] bytes = new byte[20]; random.nextBytes(bytes); return StringUtils.byteToHexString(bytes); } }
private static String randomString(Random random) { final byte[] bytes = new byte[20]; random.nextBytes(bytes); return StringUtils.byteToHexString(bytes); } }
private static String randomString(Random random) { final byte[] bytes = new byte[20]; random.nextBytes(bytes); return StringUtils.byteToHexString(bytes); } }
private static String randomString(Random random) { byte[] bytes = new byte[RANDOM_BYTES_LENGTH]; random.nextBytes(bytes); return StringUtils.byteToHexString(bytes); } }
private static String randomString(Random random) { byte[] bytes = new byte[RANDOM_BYTES_LENGTH]; random.nextBytes(bytes); return StringUtils.byteToHexString(bytes); } }
private static String randomString(Random random) { byte[] bytes = new byte[RANDOM_BYTES_LENGTH]; random.nextBytes(bytes); return StringUtils.byteToHexString(bytes); } }
private static String randomString(Random random) { byte[] bytes = new byte[RANDOM_BYTES_LENGTH]; random.nextBytes(bytes); return StringUtils.byteToHexString(bytes); } }
private static String randomString(Random random) { final byte[] bytes = new byte[20]; random.nextBytes(bytes); return StringUtils.byteToHexString(bytes); } }
@Override public String toString() { if (this.toString == null) { final byte[] ba = new byte[SIZE]; longToByteArray(this.lowerPart, ba, 0); longToByteArray(this.upperPart, ba, SIZE_OF_LONG); this.toString = StringUtils.byteToHexString(ba); } return this.toString; }
@Override public String toString() { if (this.toString == null) { final byte[] ba = new byte[SIZE]; longToByteArray(this.lowerPart, ba, 0); longToByteArray(this.upperPart, ba, SIZE_OF_LONG); this.toString = StringUtils.byteToHexString(ba); } return this.toString; }