本文整理了Java中java.io.Console.setEcho()
方法的一些代码示例,展示了Console.setEcho()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Console.setEcho()
方法的具体详情如下:
包路径:java.io.Console
类名称:Console
方法名:setEcho
暂无
代码示例来源:origin: robovm/robovm
/**
* Reads a password from the console. The password will not be echoed to the display.
*
* @return a character array containing the password, or null at EOF.
*/
public char[] readPassword() {
synchronized (CONSOLE_LOCK) {
int previousState = setEcho(false, 0);
try {
String password = readLine();
writer.println(); // We won't have echoed the user's newline.
return (password == null) ? null : password.toCharArray();
} finally {
setEcho(true, previousState);
}
}
}
代码示例来源:origin: MobiVM/robovm
/**
* Reads a password from the console. The password will not be echoed to the display.
*
* @return a character array containing the password, or null at EOF.
*/
public char[] readPassword() {
synchronized (CONSOLE_LOCK) {
int previousState = setEcho(false, 0);
try {
String password = readLine();
writer.println(); // We won't have echoed the user's newline.
return (password == null) ? null : password.toCharArray();
} finally {
setEcho(true, previousState);
}
}
}
代码示例来源:origin: ibinti/bugvm
/**
* Reads a password from the console. The password will not be echoed to the display.
*
* @return a character array containing the password, or null at EOF.
*/
public char[] readPassword() {
synchronized (CONSOLE_LOCK) {
int previousState = setEcho(false, 0);
try {
String password = readLine();
writer.println(); // We won't have echoed the user's newline.
return (password == null) ? null : password.toCharArray();
} finally {
setEcho(true, previousState);
}
}
}
代码示例来源:origin: com.gluonhq/robovm-rt
/**
* Reads a password from the console. The password will not be echoed to the display.
*
* @return a character array containing the password, or null at EOF.
*/
public char[] readPassword() {
synchronized (CONSOLE_LOCK) {
int previousState = setEcho(false, 0);
try {
String password = readLine();
writer.println(); // We won't have echoed the user's newline.
return (password == null) ? null : password.toCharArray();
} finally {
setEcho(true, previousState);
}
}
}
代码示例来源:origin: com.mobidevelop.robovm/robovm-rt
/**
* Reads a password from the console. The password will not be echoed to the display.
*
* @return a character array containing the password, or null at EOF.
*/
public char[] readPassword() {
synchronized (CONSOLE_LOCK) {
int previousState = setEcho(false, 0);
try {
String password = readLine();
writer.println(); // We won't have echoed the user's newline.
return (password == null) ? null : password.toCharArray();
} finally {
setEcho(true, previousState);
}
}
}
代码示例来源:origin: com.bugvm/bugvm-rt
/**
* Reads a password from the console. The password will not be echoed to the display.
*
* @return a character array containing the password, or null at EOF.
*/
public char[] readPassword() {
synchronized (CONSOLE_LOCK) {
int previousState = setEcho(false, 0);
try {
String password = readLine();
writer.println(); // We won't have echoed the user's newline.
return (password == null) ? null : password.toCharArray();
} finally {
setEcho(true, previousState);
}
}
}
代码示例来源:origin: com.jtransc/jtransc-rt
/**
* Reads a password from the console. The password will not be echoed to the display.
*
* @return a character array containing the password, or null at EOF.
*/
public char[] readPassword() {
synchronized (CONSOLE_LOCK) {
int previousState = setEcho(false, 0);
try {
String password = readLine();
writer.println(); // We won't have echoed the user's newline.
return (password == null) ? null : password.toCharArray();
} finally {
setEcho(true, previousState);
}
}
}
代码示例来源:origin: FlexoVM/flexovm
/**
* Reads a password from the console. The password will not be echoed to the display.
*
* @return a character array containing the password, or null at EOF.
*/
public char[] readPassword() {
synchronized (CONSOLE_LOCK) {
int previousState = setEcho(false, 0);
try {
String password = readLine();
writer.println(); // We won't have echoed the user's newline.
return (password == null) ? null : password.toCharArray();
} finally {
setEcho(true, previousState);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!