X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fcommons%2Fdata%2FHexConverter.java;h=55f264bffed9577f33e821a1de4954604563d0af;hb=443c6a564efa9f5868fd81c0db23a480cbe3cab4;hp=e2f2007aa7612c288b0cc4f4550b6d45ed89c99a;hpb=cf965fda534cc562368c9f2a3f34475e2519fcdc;p=svjatoslav_commons.git diff --git a/src/main/java/eu/svjatoslav/commons/data/HexConverter.java b/src/main/java/eu/svjatoslav/commons/data/HexConverter.java old mode 100644 new mode 100755 index e2f2007..55f264b --- a/src/main/java/eu/svjatoslav/commons/data/HexConverter.java +++ b/src/main/java/eu/svjatoslav/commons/data/HexConverter.java @@ -1,30 +1,30 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2013, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu - * + * Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation. + * modify it under the terms of version 3 of the GNU Lesser General Public License + * or later as published by the Free Software Foundation. */ package eu.svjatoslav.commons.data; public class HexConverter { - static final String hexCharacters = "0123456789ABCDEF"; + static final String hexCharacters = "0123456789ABCDEF"; - public static String byteArrayToHex(final byte[] bytes) { + public static String byteArrayToHex(final byte[] bytes) { - if (bytes == null) - return null; + if (bytes == null) + return null; - final StringBuilder result = new StringBuilder(2 * bytes.length); + final StringBuilder result = new StringBuilder(2 * bytes.length); - for (final byte b : bytes) - result.append(hexCharacters.charAt((b & 0xF0) >> 4)).append( - hexCharacters.charAt((b & 0x0F))); + for (final byte b : bytes) + result.append(hexCharacters.charAt((b & 0xF0) >> 4)).append( + hexCharacters.charAt((b & 0x0F))); - return result.toString(); - } + return result.toString(); + } }