Package org.openquark.cal.internal.serialization

Examples of org.openquark.cal.internal.serialization.RecordInputStream$Bookmark


           
            if (is == null) {
                throw new IOException ("Error reading compiled definition for module " + cmsd.getModuleName() + " : " + status.getMessage());
            }
           
            RecordInputStream ris = new RecordInputStream(is);

            try {
                // read the timestamp.
                ris.findRecord(ModuleSerializationTags.SERIALIZATION_INFO);
                this.timeStamp = ris.readLong();
               
                // read the code info
                this.codeInfo = Module.loadGeneratedCodeInfo(ris);
                ris.skipRestOfRecord();

                // Read the imports information.
                this.importedModuleNames = Module.readDependencies(ris);
           
            } finally {
                try {
                    ris.close();
                } catch (IOException e) {
                    // Ignore this particular exception.
                }
            }
        }
View Full Code Here


                        logMessage(new CompilerMessage(new SourceRange(moduleName), new MessageKind.Fatal.CompilationAbortedDueToInternalModuleLoadingError(moduleName, " Unable to access backing store.")));
                        return new CompiledModuleLoadStatus.ExceptionCaughtOrInternalError();

                    } else {
                        // Get a record import stream.
                        RecordInputStream rs = new RecordInputStream(fis);

                        try {
                            Module m = Module.load(rs, allExistingModules, foreignClassLoader, compiledDefinitionInfo.getCodeInfo(), msgLogger);

                            if (m != null) {
                                // Succeeded in loading the module.
                                allExistingModules.put (m.getName(), m);
                                packager.addModule(m);
                            }

                            // Attempted load, continue with next module
                            return new CompiledModuleLoadStatus.LoadAttempted();
                       
                        } finally {
                            rs.close();
                        }
                    }

                } else if (compiledModuleTimestampCheckStatus instanceof TimestampCheckStatus.OlderThanSource) {
                    return new CompiledModuleLoadStatus.OlderThanSource();
View Full Code Here

        RecordOutputStream ros = new RecordOutputStream(bos);
        inTypeExpr.write(ros);
        ros.close();
       
        ByteArrayInputStream bis = new ByteArrayInputStream(bos.getByteArray());
        RecordInputStream ris = new RecordInputStream(bis);

        CompilerMessageLogger msgLogger = new MessageLogger();
       
        TypeExpr outTypeExpr = TypeExpr.load(ris, getTestModuleTypeInfo(), msgLogger);
        ris.close();
       
        assertTrue(msgLogger.getMaxSeverity().compareTo(CompilerMessage.Severity.ERROR) < 0);
        return outTypeExpr;
    }
View Full Code Here

        ProgramResourceLocator.File compileModuleInfoFileLocator = moduleFolder.extendFile(moduleName + "." + Module.COMPILED_MODULE_SUFFIX);

        try {
            InputStream is = resourceRepository.getContents(compileModuleInfoFileLocator);
            if (is != null) {
                RecordInputStream ris = new RecordInputStream(is);

                try {
                    return LECCModule.readLeccSpecificSerializationInfo(ris);

                } finally {
                    try {
                        ris.close();
                    } catch (IOException e) {
                        // Ignore this particular exception
                    }
                }
            }
View Full Code Here

TOP

Related Classes of org.openquark.cal.internal.serialization.RecordInputStream$Bookmark

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.