/** * Returns the Java Unicode escape sequence for the given {@code char}, in the form "\u12AB" where * "12AB" is the four hexadecimal digits representing the 16-bit code unit. */ private static String showCharacter(char c) { String hex = "0123456789ABCDEF"; char[] tmp = {'\\', 'u', '\0', '\0', '\0', '\0'}; for (int i = 0; i < 4; i++) { tmp[5 - i] = hex.charAt(c & 0xF); c = (char) (c >> 4); } return String.copyValueOf(tmp); }
/** * Returns the Java Unicode escape sequence for the given {@code char}, in the form "\u12AB" where * "12AB" is the four hexadecimal digits representing the 16-bit code unit. */ private static String showCharacter(char c) { String hex = "0123456789ABCDEF"; char[] tmp = {'\\', 'u', '\0', '\0', '\0', '\0'}; for (int i = 0; i < 4; i++) { tmp[5 - i] = hex.charAt(c & 0xF); c = (char) (c >> 4); } return String.copyValueOf(tmp); }
/** * Returns the Java Unicode escape sequence for the given {@code char}, in the form "\u12AB" where * "12AB" is the four hexadecimal digits representing the 16-bit code unit. */ private static String showCharacter(char c) { String hex = "0123456789ABCDEF"; char[] tmp = {'\\', 'u', '\0', '\0', '\0', '\0'}; for (int i = 0; i < 4; i++) { tmp[5 - i] = hex.charAt(c & 0xF); c = (char) (c >> 4); } return String.copyValueOf(tmp); }
/** * Returns the Java Unicode escape sequence for the given {@code char}, in the form "\u12AB" where * "12AB" is the four hexadecimal digits representing the 16-bit code unit. */ private static String showCharacter(char c) { String hex = "0123456789ABCDEF"; char[] tmp = {'\\', 'u', '\0', '\0', '\0', '\0'}; for (int i = 0; i < 4; i++) { tmp[5 - i] = hex.charAt(c & 0xF); c = (char) (c >> 4); } return String.copyValueOf(tmp); }
public final String toString () { return String.copyValueOf(backingArray, offset + position, remaining()); } }
@Override public Object deepClone(Object obj, final Type type) { if (null == obj) { return obj; } String str = (String) obj; return String.copyValueOf(str.toCharArray()); }
public final String toString () { return String.copyValueOf(backingArray, offset + position, remaining()); } }
/** * Returns the Java Unicode escape sequence for the given character, in the form "\u12AB" where * "12AB" is the four hexadecimal digits representing the 16 bits of the UTF-16 character. */ private static String showCharacter(char c) { String hex = "0123456789ABCDEF"; char[] tmp = {'\\', 'u', '\0', '\0', '\0', '\0'}; for (int i = 0; i < 4; i++) { tmp[5 - i] = hex.charAt(c & 0xF); c = (char) (c >> 4); } return String.copyValueOf(tmp); }
@Override public List<Character> create(Character[] elements) { char[] chars = Chars.toArray(Arrays.asList(elements)); return Lists.charactersOf(String.copyValueOf(chars)); } }
private static String getBasePropMatcherName(final MethodParamModel prop, final String suffix) { final String name = prop.getName(); final int fst = Character.toUpperCase(name.codePointAt(0)); return 'm' + String.copyValueOf(Character.toChars(fst)) + name.substring(name.offsetByCodePoints(0, 1)) + suffix; }
@Override public void print( char[] s ) { log.logDebug( String.copyValueOf( s ) ); }
@Override public void println( char[] s ) { log.logDebug( String.copyValueOf( s ) + Const.CR ); }
@Override public final String toString() { return String.copyValueOf(backingArray, arrayOffset + position, remaining()); } }
@Override public void write(char[] cbuf, int off, int len) throws IOException { logger.info(String.copyValueOf(cbuf, off, len).replace("\n", "").replace(" ", delimiter)); }
@Override public String onUserPassword(String header, String message) { if (!isInteractive) { throw new RuntimeException("Repository is encrypted, but no password was given in non-interactive mode."); } out.println(); if (header != null) { out.println(header); out.println(Strings.repeat("-", header.length())); } if (!message.trim().endsWith(":")) { message += ": "; } char[] passwordChars = console.readPassword(message); return String.copyValueOf(passwordChars); }
@AndroidIncompatible // slow @GwtIncompatible // Floats.tryParse public void testTryParseAllCodePoints() { // Exercise non-ASCII digit test cases and the like. char[] tmp = new char[2]; for (int i = Character.MIN_CODE_POINT; i < Character.MAX_CODE_POINT; i++) { Character.toChars(i, tmp, 0); checkTryParse(String.copyValueOf(tmp, 0, Character.charCount(i))); } }
@AndroidIncompatible // slow @GwtIncompatible // Doubles.tryParse public void testTryParseAllCodePoints() { // Exercise non-ASCII digit test cases and the like. char[] tmp = new char[2]; for (int i = Character.MIN_CODE_POINT; i < Character.MAX_CODE_POINT; i++) { Character.toChars(i, tmp, 0); checkTryParse(String.copyValueOf(tmp, 0, Character.charCount(i))); } }
private void validateCallbacks(String user, String passwd, Callback[] callbacks) throws IOException, UnsupportedCallbackException { for (Callback cb : callbacks) { if (cb instanceof NameCallback) { assertEquals(user, ((NameCallback) cb).getName()); } else if (cb instanceof PasswordCallback) { char[] passwordChar = ((PasswordCallback) cb).getPassword(); assertEquals(passwd, passwordChar == null ? null : String.copyValueOf(passwordChar)); } } } }
public void read(MaryRandomAccessFile stream) throws IOException { featureDimension = stream.readIntEndian(); totalComponents = stream.readIntEndian(); isDiagonalCovariance = stream.readBooleanEndian(); int tmpLen = stream.readIntEndian(); if (tmpLen > 0) info = String.copyValueOf(stream.readCharEndian(tmpLen)); weights = stream.readDoubleEndian(totalComponents); components = new GaussianComponent[totalComponents]; for (int i = 0; i < totalComponents; i++) { components[i] = new GaussianComponent(); components[i].read(stream); } } }
public void read(MaryRandomAccessFile stream) throws IOException { featureDimension = stream.readIntEndian(); totalComponents = stream.readIntEndian(); isDiagonalCovariance = stream.readBooleanEndian(); int tmpLen = stream.readIntEndian(); if (tmpLen > 0) info = String.copyValueOf(stream.readCharEndian(tmpLen)); weights = stream.readDoubleEndian(totalComponents); components = new GaussianComponent[totalComponents]; for (int i = 0; i < totalComponents; i++) { components[i] = new GaussianComponent(); components[i].read(stream); } } }