Package com.google.common.io

Examples of com.google.common.io.CharSource


    {
        try
        {
            File mapData = new File(deobfFileName);
            LZMAInputSupplier zis = new LZMAInputSupplier(new FileInputStream(mapData));
            CharSource srgSource = zis.asCharSource(Charsets.UTF_8);
            List<String> srgList = srgSource.readLines();
            rawMethodMaps = Maps.newHashMap();
            rawFieldMaps = Maps.newHashMap();
            Builder<String, String> builder = ImmutableBiMap.<String,String>builder();
            Splitter splitter = Splitter.on(CharMatcher.anyOf(": ")).omitEmptyStrings().trimResults();
            for (String line : srgList)
View Full Code Here


        this.classLoader = classLoader;
        try
        {
            InputStream classData = getClass().getResourceAsStream(deobfFileName);
            LZMAInputSupplier zis = new LZMAInputSupplier(classData);
            CharSource srgSource = zis.asCharSource(Charsets.UTF_8);
            List<String> srgList = srgSource.readLines();
            rawMethodMaps = Maps.newHashMap();
            rawFieldMaps = Maps.newHashMap();
            Builder<String, String> builder = ImmutableBiMap.<String,String>builder();
            Splitter splitter = Splitter.on(CharMatcher.anyOf(": ")).omitEmptyStrings().trimResults();
            for (String line : srgList)
View Full Code Here

            }
        };
    }

    protected CharSource reader(final String resourceId) {
        return new CharSource() {
            @Override
            public Reader openStream() throws IOException {
                return new InputStreamReader(loader.getResource(resourceId).getInputStream(), UTF_8);
            }
        };
View Full Code Here

    protected Map<String, RestxSpec> buildSpecsMap(boolean searchInSources) {
        Map<String, RestxSpec> specsMap = Maps.newLinkedHashMap();
        Map<String, URL> specs = MoreResources.findResources("", Pattern.compile(".*\\.spec\\.yaml"), searchInSources);
        for (final Map.Entry<String, URL> spec : specs.entrySet()) {
            try {
                specsMap.put(spec.getKey(), specLoader.load(spec.getKey(), new CharSource() {
                    @Override
                    public Reader openStream() throws IOException {
                        return new InputStreamReader(spec.getValue().openStream(), Charsets.UTF_8);
                    }
                }));
View Full Code Here

TOP

Related Classes of com.google.common.io.CharSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.