类 Util
java.lang.Object
com.lark.oapi.okhttp.internal.Util
Junk drawer of utility methods.
-
字段概要
字段修饰符和类型字段说明static final byte[]static final Headersstatic final RequestBodystatic final ResponseBodystatic final String[]static final Comparator<String> static final TimeZoneGMT and UTC are equivalent for our purposes. -
方法概要
修饰符和类型方法说明static voidaddSuppressedIfPossible(Throwable e, Throwable suppressed) static CharsetbomAwareCharset(BufferedSource source, Charset charset) static StringcanonicalizeHost(String host) Ifhostis an IP address, this returns the IP address in canonical form.static intcheckDuration(String name, long duration, TimeUnit unit) static voidcheckOffsetAndCount(long arrayLength, long offset, long count) static voidcloseQuietly(Closeable closeable) Closescloseable, ignoring any checked exceptions.static voidcloseQuietly(ServerSocket serverSocket) ClosesserverSocket, ignoring any checked exceptions.static voidcloseQuietly(Socket socket) Closessocket, ignoring any checked exceptions.static String[]static intdecodeHexDigit(char c) static intdelimiterOffset(String input, int pos, int limit, char delimiter) Returns the index of the first character ininputthat isdelimiter.static intdelimiterOffset(String input, int pos, int limit, String delimiters) Returns the index of the first character ininputthat contains a character indelimiters.static booleanAttempts to exhaustsource, returning true if successful.static Stringstatic StringgetSystemProperty(String key, String defaultValue) Returns the system property, or defaultValue if the system property is null or cannot be read (e.g. because of security policy restrictions).static StringhostHeader(HttpUrl url, boolean includeDefaultPort) static <T> List<T> immutableList(List<T> list) Returns an immutable copy oflist.static <T> List<T> immutableList(T... elements) Returns an immutable list containingelements.static <K,V> Map <K, V> immutableMap(Map<K, V> map) Returns an immutable copy ofmap.static intindexOf(Comparator<String> comparator, String[] array, String value) static intindexOfControlOrNonAscii(String input) Returns the index of the first character ininputthat is either a control character (like