本文整理了Java中org.crsh.util.Utils.readAsBytes()
方法的一些代码示例,展示了Utils.readAsBytes()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.readAsBytes()
方法的具体详情如下:
包路径:org.crsh.util.Utils
类名称:Utils
方法名:readAsBytes
暂无
代码示例来源:origin: crashub/crash
public Resource(String name, URL url) throws IOException {
URLConnection conn = url.openConnection();
this.name = name;
this.timestamp = conn.getLastModified();
this.content = Utils.readAsBytes(conn.getInputStream());
}
代码示例来源:origin: crashub/crash
Iterator<Resource> getResources() throws IOException {
Iterator<InputStream> i = driver.open(handle);
if (i.hasNext()) {
LinkedList<Resource> resources = new LinkedList<Resource>();
while (i.hasNext()) {
InputStream in = i.next();
byte[] bytes = Utils.readAsBytes(in);
long lastModified = getLastModified();
resources.add(new Resource(name, bytes, lastModified));
}
return resources.iterator();
} else {
return Utils.iterator();
}
}
代码示例来源:origin: crashub/crash
Resource getResource() throws IOException {
InputStream in = open();
byte[] bytes = Utils.readAsBytes(in);
long lastModified = getLastModified();
return new Resource(name, bytes, lastModified);
}
代码示例来源:origin: crashub/crash
assertTrue(tmp.delete());
war.as(ZipExporter.class).exportTo(tmp);
final byte[] bytes = Utils.readAsBytes(jar.get("foo/A.class").getAsset().openStream());
return new ClassLoader(Thread.currentThread().getContextClassLoader()) {
Class<?> aClass = null;
代码示例来源:origin: crashub/crash
public void testNestedJar() throws Exception {
//
URLDriver driver = new URLDriver();
driver.merge(new URL("jar:" + warFile.toURI().toURL() + "!/WEB-INF/"));
Node root = driver.root();
Node lib = driver.child(root, "lib");
Node foo_jar = driver.child(lib, "foo.jar");
assertNotNull(foo_jar);
Iterator<InputStream> in = driver.open(foo_jar);
assertNotNull(in);
assertTrue(in.hasNext());
byte[] bytes = Utils.readAsBytes(in.next());
assertFalse(in.hasNext());
//
URL url = new URL("jar:jar:" + warFile.toURI().toURL() + "!/WEB-INF/lib/foo.jar!/org/crsh/");
driver = new URLDriver();
driver.merge(url);
root = driver.root();
Node vfs = driver.child(root, "vfs");
Node FSTestCase_class = driver.child(vfs, "FSTestCase.class");
assertNotNull(FSTestCase_class);
in = driver.open(FSTestCase_class);
assertNotNull(in);
assertTrue(in.hasNext());
bytes = Utils.readAsBytes(in.next());
assertFalse(in.hasNext());
}
代码示例来源:origin: com.github.corda.crash/crash.shell
public Resource(String name, URL url) throws IOException {
URLConnection conn = url.openConnection();
this.name = name;
this.timestamp = conn.getLastModified();
this.content = Utils.readAsBytes(conn.getInputStream());
}
代码示例来源:origin: crashub/crash
byte[] bytes = Utils.readAsBytes(in);
assertTrue(bytes.length > 0);
代码示例来源:origin: org.crashub/crash.shell
public Resource(String name, URL url) throws IOException {
URLConnection conn = url.openConnection();
this.name = name;
this.timestamp = conn.getLastModified();
this.content = Utils.readAsBytes(conn.getInputStream());
}
代码示例来源:origin: org.crashub/crash.shell
Iterator<Resource> getResources() throws IOException {
Iterator<InputStream> i = driver.open(handle);
if (i.hasNext()) {
LinkedList<Resource> resources = new LinkedList<Resource>();
while (i.hasNext()) {
InputStream in = i.next();
byte[] bytes = Utils.readAsBytes(in);
long lastModified = getLastModified();
resources.add(new Resource(name, bytes, lastModified));
}
return resources.iterator();
} else {
return Utils.iterator();
}
}
代码示例来源:origin: com.github.corda.crash/crash.shell
Iterator<Resource> getResources() throws IOException {
Iterator<InputStream> i = driver.open(handle);
if (i.hasNext()) {
LinkedList<Resource> resources = new LinkedList<Resource>();
while (i.hasNext()) {
InputStream in = i.next();
byte[] bytes = Utils.readAsBytes(in);
long lastModified = getLastModified();
resources.add(new Resource(name, bytes, lastModified));
}
return resources.iterator();
} else {
return Utils.iterator();
}
}
代码示例来源:origin: com.github.corda.crash/crash.shell
Resource getResource() throws IOException {
InputStream in = open();
byte[] bytes = Utils.readAsBytes(in);
long lastModified = getLastModified();
return new Resource(name, bytes, lastModified);
}
代码示例来源:origin: org.crashub/crash.shell
Resource getResource() throws IOException {
InputStream in = open();
byte[] bytes = Utils.readAsBytes(in);
long lastModified = getLastModified();
return new Resource(name, bytes, lastModified);
}
内容来源于网络,如有侵权,请联系作者删除!