Converts the specified smile bytes (UTF-8) into an instance of type T.

@param bytes the bytes (UTF-8) to parse
@return parsed response; never null
@throws IllegalArgumentException if the bytes bytes can not be converted to the type T
761303
public T fromSmile(byte[] bytes)
            throws IllegalArgumentException
    {
        try {
            return mapper.readValue(bytes, javaType);
        }
        catch (IOException e) {
            throw new IllegalArgumentException(format("Invalid SMILE bytes for %s", javaType), e);
        }
    }
97929
protected <T> T decode(byte[] bytes) {
    return bytes != null ? userSerializer.decode(bytes) : null;
  }
239978
public static void assertNotNullEightBytes(byte[] bytes) {
        if (bytes == null) {
            throw new IllegalArgumentException("Expected 8 bytes, but got null.");
        }
        if (bytes.length != 8) {
            throw new IllegalArgumentException(String.format("Expected 8 bytes, but got: %d bytes.", bytes.length));
        }
    }
201393
private static String bytesToHex(byte[] bytes) {
        char[] hexChars = new char[bytes.length * 2];
        for (int i = 0; i < bytes.length; i++) {
            int v = bytes[i] & 0xFF;
            hexChars[i * 2] = hexArray[v >>> 4];
            hexChars[i * 2 + 1] = hexArray[v & 0x0F];
        }
        return new String(hexChars);
    }
1116404
@Override
    public final String fromBytes(Class targetClass, byte[] bytes)
    {

        try
        {
            return bytes != null ? new String(bytes, Constants.CHARSET_UTF8) : null;
        }
        catch (UnsupportedEncodingException e)
        {
            log.error("Unsupported encoding exception, Caused by {}.", e);
            throw new PropertyAccessException(e);
        }

    }
2180
public Ast parse(byte[] serialized) throws ParseException
	{
		try {
			return parse(new String(serialized, "utf-8"));
		} catch (UnsupportedEncodingException e) {
			throw new ParseException(e.toString());
		}
	}
79332
public static <S extends Serializable> S deserialize(byte[] bytes) throws IOException {
    if (bytes == null) {
      return null;
    }
    return deserialize(new ByteArrayInputStream(bytes));
  }
128742
public static byte[] getBytes(String text) {
		byte[] bytes = new byte[] {};
		try {
			bytes = text.getBytes("utf-8");
		} catch (UnsupportedEncodingException e) {
		}
		return bytes;
	}
373649
public static long bytesToLong(byte[] bytes) {
		// Magic number 8 should be defined as Long.SIZE / Byte.SIZE
		long values = 0;
		for (int i = 0; i < 8; i++) {
			values <<= 8;
			values |= (bytes[i] & 0xff);
		}
		return values;
	}
1002914
public static long getPrefix(byte[] bytes) {
    if (bytes == null) {
      return 0L;
    } else {
      final int minLen = Math.min(bytes.length, 8);
      long p = 0;
      for (int i = 0; i < minLen; ++i) {
        p |= ((long) Platform.getByte(bytes, Platform.BYTE_ARRAY_OFFSET + i) & 0xff)
            << (56 - 8 * i);
      }
      return p;
    }
  }
710403
public static String byteArrayToHexString(byte[] bytes) {
    char[] hexChars = new char[bytes.length * 2];
    for (int j = 0; j < bytes.length; j++) {
      int v = bytes[j] & 0xFF;
      hexChars[j * 2] = HEX_SYMBOLS[v >>> 4];
      hexChars[j * 2 + 1] = HEX_SYMBOLS[v & 0x0F];
    }
    return new String(hexChars);
  }
1278745
public static String bytesToBase64Url(byte[] bytes) {
        String result = (new String(Base64.encodeBase64(bytes), MESSAGE_ENCODING)).replace("=", "").replace("\\", "").replace('+', '-')
                .replace('/', '_');
        return result;
    }
1053976
public static String toHex(byte[] bytes) {
    final char[] string = new char[2 * bytes.length];
    int i = 0;
    for (byte b : bytes) {
      string[i++] = hexDigits[(b >> 4) & 0x0f];
      string[i++] = hexDigits[b & 0x0f];
    }
    return new String(string);
  }
870279
public static Base64Url encode(byte[] bytes) {
        if (bytes == null) {
            return new Base64Url((String) null);
        } else {
            return new Base64Url(Base64Util.encodeURLWithoutPadding(bytes));
        }
    }
390860
public static long parseLong(byte[] bytes, int from, int to) {
        long result = 0;
        for (int i = from; i < to && i < bytes.length; i++) {
            result *= 10;
            result += (bytes[i] - (byte) '0');
        }
        return result;
    }
828358
public static String toStringUTF8(byte[] bytes, int offset, int length)
    {
        if (bytes == null)
        {
            return null;
        }

        try
        {
            return new String(bytes, offset, length, "UTF-8");
        }
        catch (UnsupportedEncodingException e)
        {
            // This never happens.
            return null;
        }
        catch (IndexOutOfBoundsException e)
        {
            return null;
        }
    }
355000
public static String encode(byte[] bytes) {
    if (null == bytes) {
      return null;
    }
    ByteArrayOutputStream out = new ByteArrayOutputStream((int) (bytes.length * 1.37));
    Base64Encoder encodedOut = new Base64Encoder(out);

    try {
      encodedOut.write(bytes);
      encodedOut.close();

      return out.toString("UTF-8");
    } catch (IOException ignored) {
      return null;
    }
  }