用于校验一个字符串是否是合法的JSON格式 * */ import java.text.CharacterIterator; import java.text.StringCharacterIterator;
import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java
import java.util.Arrays; import java.util.Random; public class QuickSort { public static final Random
package dec; import java.util.Properties; import javax.mail.Message; import javax.mail.MessagingException;
import java.util.LinkedList; import java.util.Objects; /** * 基数排序的思想是多关键字排序 * @author yuncong * */ public
import java.awt.BasicStroke; import java.awt.Color; import java.awt.Graphics2D; import java.awt.Image;
import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URL; import java.security
冒泡排序 public class BubbleSort { public static int[] bubbleSort(int[] array) { if (array == null) { return null; } for (int i = 0; i < array.length; i++) { for (int j = i + 1; j < array.length; j++) { i
import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.Rectangle; import
URL url = new URL(Config.local + "/excel/" + name); HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection(); // 设置请求信息 httpConnection.setRequestProperty("GET", "/down.zip HTTP/1.1"
util; import java.io.UnsupportedEncodingException; import java.util.Locale; import java.util.regex.Matcher;
/** * @file HttpUtil.java * * @brief * HttpUtil is a single class containing methods to conveniently
1、ArrayList java.util.ArrayList
import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileOutputStream; import java
System.setProperty("http.maxRedirects", "50"); System.getProperties().setProperty("proxySet", "true"); // 如果不设置,只要代理IP和代理端口正确,此项不设置也可以 System.getProperties().setProperty("http.proxyHost",“代理ip地址”); Sy
/** * 默认GB18030 */ public static final String detectCharset(byte[] byteArray){ // 建立InputStream ByteArrayInputStream bais = new ByteArrayInputStream(byteArray); // 默认编码 String utf8 = "UTF-8"; String c
具体代码如下: import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.RandomAccessFile;
import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java
这个类。这里写了一个简单的示例代码记录一下 import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream;
获取本地服务器IP经常会出现127.0.0.1,0:0:0:0:0:0:0:1,fe80:0:0:0:960:74bd:e1a0:e5b9%11 这些情况,以下代码可解决此问题 public static void main(String[] args) { try { Enumeration<NetworkInterface> enumeration = NetworkInterface .ge