当前位置: 首页>>代码示例>>Java>>正文


Java ImageReader类代码示例

本文整理汇总了Java中jdk.internal.jimage.ImageReader的典型用法代码示例。如果您正苦于以下问题:Java ImageReader类的具体用法?Java ImageReader怎么用?Java ImageReader使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ImageReader类属于jdk.internal.jimage包,在下文中一共展示了ImageReader类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: open

import jdk.internal.jimage.ImageReader; //导入依赖的package包/类
static SystemImage open() throws IOException {
    if (modulesImageExists) {
        // open a .jimage and build directory structure
        final ImageReader image = ImageReader.open(moduleImageFile);
        image.getRootDirectory();
        return new SystemImage() {
            @Override
            Node findNode(String path) throws IOException {
                return image.findNode(path);
            }
            @Override
            byte[] getResource(Node node) throws IOException {
                return image.getResource(node);
            }
            @Override
            void close() throws IOException {
                image.close();
            }
        };
    }
    if (Files.notExists(explodedModulesDir))
        throw new FileSystemNotFoundException(explodedModulesDir.toString());
    return new ExplodedImage(explodedModulesDir);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:25,代码来源:SystemImage.java

示例2: findNode

import jdk.internal.jimage.ImageReader; //导入依赖的package包/类
private NodeAndImage findNode(byte[] path) throws IOException {
    ImageReader image = bootImage;
    Node node = bootImage.findNode(path);
    if (node == null) {
        image = extImage;
        node = extImage.findNode(path);
    }
    if (node == null) {
        image = appImage;
        node = appImage.findNode(path);
    }
    if (node == null || node.isTopLevelPackageDir()) {
        throw new NoSuchFileException(getString(path));
    }
    return new NodeAndImage(node, image);
}
 
开发者ID:forax,项目名称:jigsaw-jrtfs,代码行数:17,代码来源:JrtFileSystem.java

示例3: ClassPathJimageEntry

import jdk.internal.jimage.ImageReader; //导入依赖的package包/类
public ClassPathJimageEntry(Path root) {
    super(root);
    if (!Files.exists(root)) {
        throw new Error(root + " image file not found");
    }
    try {
        reader = ImageReader.open(root);
    } catch (IOException e) {
        throw new Error("can not open " + root + " : " + e.getMessage(), e);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:ClassPathJimageEntry.java

示例4: findImageLocation

import jdk.internal.jimage.ImageReader; //导入依赖的package包/类
/**
 * Returns the ImageLocation for the given resource, {@code null}
 * if not found.
 */
private ImageLocation findImageLocation(String name) throws IOException {
    Objects.requireNonNull(name);
    if (closed)
        throw new IOException("ModuleReader is closed");
    ImageReader imageReader = SystemImage.reader();
    if (imageReader != null) {
        return imageReader.findLocation(module, name);
    } else {
        // not an images build
        return null;
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:SystemModuleFinders.java

示例5: ModuleContentSpliterator

import jdk.internal.jimage.ImageReader; //导入依赖的package包/类
ModuleContentSpliterator(String module) throws IOException {
    moduleRoot = "/modules/" + module;
    stack = new ArrayDeque<>();

    // push the root node to the stack to get started
    ImageReader.Node dir = SystemImage.reader().findNode(moduleRoot);
    if (dir == null || !dir.isDirectory())
        throw new IOException(moduleRoot + " not a directory");
    stack.push(dir);
    iterator = Collections.emptyIterator();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:SystemModuleFinders.java

示例6: reader

import jdk.internal.jimage.ImageReader; //导入依赖的package包/类
static ImageReader reader() {
    return READER;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:4,代码来源:SystemModuleFinders.java

示例7: release

import jdk.internal.jimage.ImageReader; //导入依赖的package包/类
@Override
public void release(ByteBuffer bb) {
    Objects.requireNonNull(bb);
    ImageReader.releaseByteBuffer(bb);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:6,代码来源:SystemModuleFinders.java

示例8: openImage

import jdk.internal.jimage.ImageReader; //导入依赖的package包/类
private static ImageReader openImage(Path path) throws IOException {
    ImageReader image = ImageReader.open(path.toString());
    image.getRootDirectory();
    return image;
}
 
开发者ID:forax,项目名称:jigsaw-jrtfs,代码行数:6,代码来源:JrtFileSystem.java

示例9: NodeAndImage

import jdk.internal.jimage.ImageReader; //导入依赖的package包/类
NodeAndImage(Node node, ImageReader image) {
    this.node = node; this.image = image;
}
 
开发者ID:forax,项目名称:jigsaw-jrtfs,代码行数:4,代码来源:JrtFileSystem.java


注:本文中的jdk.internal.jimage.ImageReader类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。