本文整理汇总了Java中org.apache.harmony.luni.util.Util.toUTF8String方法的典型用法代码示例。如果您正苦于以下问题:Java Util.toUTF8String方法的具体用法?Java Util.toUTF8String怎么用?Java Util.toUTF8String使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.harmony.luni.util.Util
的用法示例。
在下文中一共展示了Util.toUTF8String方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: list
import org.apache.harmony.luni.util.Util; //导入方法依赖的package包/类
/**
* Returns an array of strings with the file names in the directory
* represented by this file. The result is {@code null} if this file is not
* a directory.
* <p>
* The entries {@code .} and {@code ..} representing the current and parent
* directory are not returned as part of the list.
*
* @return an array of strings with file names or {@code null}.
* @throws SecurityException
* if a {@code SecurityManager} is installed and it denies read
* access to this file.
* @see #isDirectory
* @see java.lang.SecurityManager#checkRead(FileDescriptor)
*/
public java.lang.String[] list() {
SecurityManager security = System.getSecurityManager();
if (security != null) {
security.checkRead(path);
}
if (path.length() == 0) {
return null;
}
byte[] bs = properPath(true);
if (!isDirectoryImpl(bs) || !existsImpl(bs) || isWriteOnlyImpl(bs)) {
return null;
}
byte[][] implList = listImpl(bs);
if (implList == null) {
// empty list
return new String[0];
}
String result[] = new String[implList.length];
for (int index = 0; index < implList.length; index++) {
result[index] = Util.toUTF8String(implList[index]);
}
return result;
}
示例2: test_getContent
import org.apache.harmony.luni.util.Util; //导入方法依赖的package包/类
/**
* @tests java.net.URLConnection#getContent()
*/
public void test_getContent() throws IOException {
byte[] ba = new byte[600];
((InputStream) uc.getContent()).read(ba, 0, 600);
String s = Util.toUTF8String(ba);
assertTrue("Incorrect content returned",
s.indexOf("Hello OneHandler") > 0);
}
示例3: getAbsolutePath
import org.apache.harmony.luni.util.Util; //导入方法依赖的package包/类
/**
* Returns the absolute path of this file.
*
* @return the absolute file path.
*
* @see java.lang.SecurityManager#checkPropertyAccess
*/
public String getAbsolutePath() {
byte[] absolute = properPath(false);
return Util.toUTF8String(absolute);
}
示例4: getAbsolutePath
import org.apache.harmony.luni.util.Util; //导入方法依赖的package包/类
/**
* Returns the absolute path of this file.
*
* @return the absolute file path.
* @see java.lang.SecurityManager#checkPropertyAccess
*/
public String getAbsolutePath() {
byte[] absolute = properPath(false);
return Util.toUTF8String(absolute);
}