public final class OsUtil extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static int |
getFreePort()
获取空闲端口号
|
static int |
getFreePort(int defaultPort)
查看指定的端口号是否空闲,若空闲则返回否则返回一个随机的空闲端口号
|
static boolean |
is32()
是否为 32 位
|
static boolean |
is64()
是否为 64 位
|
static boolean |
isBusyPort(int port)
检查端口号是否被占用
|
static boolean |
isMac()
是否为 mac
|
static boolean |
isSolaris()
是否为 sunos
|
static boolean |
isUnix()
是否为 unix
|
static boolean |
isWindows()
是否为 windows
|
static boolean |
isWindowsXP()
是否为 windows xp
|
public static int getFreePort(int defaultPort)
throws IOException
defaultPort - 默认端口IOException - 异常public static int getFreePort()
throws IOException
IOException - 异常public static boolean isBusyPort(int port)
port - 端口号public static boolean isWindows()
public static boolean isWindowsXP()
public static boolean isMac()
public static boolean isUnix()
public static boolean isSolaris()
public static boolean is64()
public static boolean is32()
Copyright © 2024. All rights reserved.