Examples of Reader

Examples of ch.epfl.lbd.io.readers.Reader

public class TestFileReader extends Tester{

  public void run() throws Exception {
    Reader reader = new FileReader(new File("src/assets/test.txt"));
    String value;
    value = (String)reader.read()[0];
    while(value != null){
      Assert.assertTrue(value.contains("this is the "));
      value = (String)reader.read()[0];
View Full Code Here

Examples of ch.softappeal.yass.serialize.Reader

    return new SocketListener() {
      @Override void accept(final Socket socket, final Executor writerExecutor) throws Exception {
        final Reader reader = Reader.create(socket.getInputStream());
        final TransportSetup setup = pathResolver.resolvePath(pathSerializer.read(reader));
        new SocketConnection(setup, socket, reader, socket.getOutputStream(), writerExecutor);
View Full Code Here

Examples of com.asakusafw.bulkloader.transfer.FileList.Reader

            final Future<Void> future = Executors.newFixedThreadPool(1).submit(new Callable<Void>() {
                public Void call() throws Exception {
                    Writer writer = FileList.createWriter(remoteStdout, false);
                    Reader reader = FileList.createReader(remoteStdin);
                    try {
                        remote.execute(reader, writer);
                    } finally {
                        // closes quitetly for piped streams
View Full Code Here

Examples of com.envoisolutions.sxc.Reader

            final GeneratedReader gr = (GeneratedReader) readerCls.newInstance();
            final GeneratedWriter gw = (GeneratedWriter) writerCls.newInstance();
            final CompiledContext ctx = this;
            this.reader = new Reader(this) {
                public Object read(XoXMLStreamReader xsr, Map<String, Object> properties)
                    throws Exception {
                    return gr.read(xsr, ctx);
View Full Code Here

Examples of com.facebook.hive.orc.Reader


        RecordReader recordReader;
        try {
            FileSystem fileSystem = path.getFileSystem(configuration);
            Reader reader = OrcFile.createReader(fileSystem, path, new JobConf(configuration));
            boolean[] include = findIncludedColumns(reader.getTypes(), columns);
            recordReader = reader.rows(start, length, include);
        catch (Exception e) {
            throw Throwables.propagate(e);
View Full Code Here

Examples of com.google.zxing.Reader

        this.checkFormat(in, format);
    private void checkFormat(File file, BarcodeFormat format) throws IOException {
        Reader reader = new MultiFormatReader();
        BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(new BufferedImageLuminanceSource(ImageIO.read(file))));
        Result result;
        try {
            result = reader.decode(bitmap);
        } catch (ReaderException ex) {
            throw new IOException(ex);
        assertEquals(format, result.getBarcodeFormat());
View Full Code Here

Examples of com.impetus.kundera.classreading.Reader

         * Check whether Classes to scan was provided into persistence.xml If
         * yes, load them. Otherwise load them from classpath/ context path
        Reader reader;
        ApplicationMetadata appMetadata = kunderaMetadata.getApplicationMetadata();
        if (classesToScan == null || classesToScan.isEmpty())
            log.info("No class to scan for persistence unit " + persistenceUnit
                    + ". Entities will be loaded from classpath/ context-path");
            // Entity metadata is not related to any PU, and hence will be
            // stored at common place
            // persistenceUnit = Constants.COMMON_ENTITY_METADATAS;

            // Check whether all common entity metadata have already been loaded
            if (appMetadata.getMetamodelMap().get(persistenceUnit) != null)
                log.info("All common entitity metadata already loaded, nothing need to be done");

            reader = new ClasspathReader();
            // resources = reader.findResourcesByClasspath();
            reader = new ClasspathReader(classesToScan);
            // resources = reader.findResourcesByContextLoader();

        InputStream[] iStreams = null;
        PersistenceUnitMetadata puMetadata = persistentUnitMetadataMap.get(persistenceUnit);
        if (this.getClass().getClassLoader() instanceof URLClassLoader && !puMetadata.getExcludeUnlistedClasses())
            URL[] managedClasses = reader.findResources();
            if (managedClasses != null)
                List<URL> managedResources = Arrays.asList(managedClasses);
            iStreams = reader.findResourcesAsStream();

        if (managedURLs != null)
            resources = managedURLs.toArray(new URL[] {});

        // All entities to load should be annotated with @Entity

        Metamodel metamodel = appMetadata.getMetamodel(persistenceUnit);
        if (metamodel == null)
            metamodel = new MetamodelImpl();

        Map<String, EntityMetadata> entityMetadataMap = ((MetamodelImpl) metamodel).getEntityMetadataMap();
        Map<String, Class<?>> entityNameToClassMap = ((MetamodelImpl) metamodel).getEntityNameToClassMap();
        Map<String, List<String>> puToClazzMap = new HashMap<String, List<String>>();
        Map<String, IdDiscriptor> entityNameToKeyDiscriptorMap = new HashMap<String, IdDiscriptor>();
        List<Class<?>> classes = new ArrayList<Class<?>>();
        if (resources != null && resources.length > 0)
            for (URL resource : resources)
                    ResourceIterator itr = reader.getResourceIterator(resource, reader.getFilter());

                    InputStream is = null;
                    while ((is = itr.next()) != null)
                        classes.addAll(scanClassAndPutMetadata(is, reader, entityMetadataMap, entityNameToClassMap,
View Full Code Here

Examples of com.maxmind.db.Reader

    private final ObjectMapper om;

    private DatabaseReader(Builder builder) throws IOException {
        if (builder.stream != null) {
            this.reader = new Reader(builder.stream);
        } else if (builder.database != null) {
            this.reader = new Reader(builder.database, builder.mode);
        } else {
            // This should never happen. If it does, review the Builder class
            // constructors for errors.
            throw new IllegalArgumentException(
                    "Unsupported Builder configuration: expected either File or URL");
View Full Code Here

Examples of com.packtpub.java7.concurrency.chapter2.recipe4.task.Reader

  public static void main(String[] args) {

    // Creates an object to store the prices
    PricesInfo pricesInfo=new PricesInfo();
    Reader readers[]=new Reader[5];
    Thread threadsReader[]=new Thread[5];
    // Creates five readers and threads to run them
    for (int i=0; i<5; i++){
      readers[i]=new Reader(pricesInfo);
      threadsReader[i]=new Thread(readers[i]);
    // Creates a writer and a thread to run it
    Writer writer=new Writer(pricesInfo);
View Full Code Here

Examples of com.zinep.script.Reader

        } catch (Exception ex) {

        Reader reader = new Reader(lineas);
View Full Code Here
Copyright © 2018 www.massapi.com. 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.