本文整理了Java中com.simiacryptus.util.Util.cacheStream()
方法的一些代码示例,展示了Util.cacheStream()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.cacheStream()
方法的具体详情如下:
包路径:com.simiacryptus.util.Util
类名称:Util
方法名:cacheStream
[英]Cache input stream.
[中]缓存输入流。
代码示例来源:origin: com.simiacryptus/java-util
/**
* Cache input stream.
*
* @param url the url
* @return the input stream
* @throws IOException the io exception
* @throws NoSuchAlgorithmException the no such algorithm exception
* @throws KeyManagementException the key management exception
*/
public static InputStream cacheStream(@javax.annotation.Nonnull final URI url) throws IOException, NoSuchAlgorithmException, KeyManagementException {
return com.simiacryptus.util.Util.cacheStream(url.toString(), new File(url.getPath()).getName());
}
代码示例来源:origin: com.simiacryptus/mindseye-labs
private static Stream<byte[]> binaryStream(@Nonnull final String name, final int skip, final int recordSize) throws IOException {
@Nullable InputStream stream = null;
try {
stream = Util.cacheStream(TestUtil.S3_ROOT.resolve(name));
} catch (@Nonnull NoSuchAlgorithmException | KeyManagementException e) {
throw new RuntimeException(e);
}
final byte[] fileData = IOUtils.toByteArray(new BufferedInputStream(new GZIPInputStream(new BufferedInputStream(stream))));
@Nonnull final DataInputStream in = new DataInputStream(new ByteArrayInputStream(fileData));
in.skip(skip);
return MNIST.toIterator(new BinaryChunkIterator(in, recordSize));
}
代码示例来源:origin: com.simiacryptus/mindseye-test
private static Stream<byte[]> binaryStream(@Nonnull final String name, final int skip, final int recordSize) throws IOException {
@Nullable InputStream stream = null;
try {
stream = Util.cacheStream(TestUtil.S3_ROOT.resolve(name));
} catch (@Nonnull NoSuchAlgorithmException | KeyManagementException e) {
throw new RuntimeException(e);
}
final byte[] fileData = IOUtils.toByteArray(new BufferedInputStream(new GZIPInputStream(new BufferedInputStream(stream))));
@Nonnull final DataInputStream in = new DataInputStream(new ByteArrayInputStream(fileData));
in.skip(skip);
return MNIST.toIterator(new BinaryChunkIterator(in, recordSize));
}
代码示例来源:origin: com.simiacryptus/mindseye
private static Stream<byte[]> binaryStream(@Nonnull final String name, final int skip, final int recordSize) throws IOException {
@Nullable InputStream stream = null;
try {
stream = Util.cacheStream(TestUtil.S3_ROOT.resolve(name));
} catch (@Nonnull NoSuchAlgorithmException | KeyManagementException e) {
throw new RuntimeException(e);
}
final byte[] fileData = IOUtils.toByteArray(new BufferedInputStream(new GZIPInputStream(new BufferedInputStream(stream))));
@Nonnull final DataInputStream in = new DataInputStream(new ByteArrayInputStream(fileData));
in.skip(skip);
return MNIST.toIterator(new BinaryChunkIterator(in, recordSize));
}
内容来源于网络,如有侵权,请联系作者删除!