Esempio n. 1
0
int network_information_table_section::subtable::read(DataInputStream&  istream ) { // throws IOException
    int retVal = 0;
    // read firstIndex
    {
        firstIndex=(istream.readUI8());
        retVal+=1;
    }
    // read numberOfRecords
    {
        numberOfRecords=(istream.readUI8());
        retVal+=1;
    }
    // read bf3
    bf3= istream.readUI8();
    retVal += 1;
    // read records
    for (int iIdx=0; iIdx <(numberOfRecords + (0)); iIdx++) {
        org_himalay_si_network_information_table_section_subtable_Record__PTR_TYPE temp;
        org_himalay_si_network_information_table_section_subtable_Record__NEW( temp);
        temp->parent=this;
        retVal += temp->read(istream);
        records.add(temp);
    }
    // read descriptor
    if ( (parent->tableHeader->getSection_length() - (retVal- 2) -4)  > 0 ) {
        org_himalay_si_Descriptors__NEW( descriptor);
        retVal += descriptor->read(istream);
    }

    return retVal;
}
Esempio n. 2
0
int codeVersionTable1_3::statusfld2::read(DataInputStream&  istream ) { // throws IOException
    int retVal = 0;
    // read mcAddress
    retVal += mcAddress->read(istream);
    // read sourceIpAddress
    retVal += sourceIpAddress->read(istream);
    // read destinationIpAddress
    retVal += destinationIpAddress->read(istream);
    // read sourcePortNumber
    {
        sourcePortNumber=istream.readUI16();
        retVal+=2;
    }
    // read destinatioPortNumber
    {
        destinatioPortNumber=istream.readUI16();
        retVal+=2;
    }
    // read applicationId
    {
        applicationId=istream.readUI16();
        retVal+=2;
    }
    // read modulationType
    {
        modulationType=(istream.readUI8());
        retVal+=1;
    }
    // read bf2
    bf2= istream.readUI16();
    retVal += 2;

    return retVal;
}
Esempio n. 3
0
int OpenSessionResponse::read(DataInputStream&  istream ) { // throws IOException
    int retVal = 0;
    // read length
    {
        length=(istream.readUI8());
        retVal+=1;
    }
    // read resourceIdentifier
    {
        resourceIdentifier=istream.readUI32() ;
        retVal+=4;
    }
    // read sessionStatus
    {
        sessionStatus=(istream.readUI8());
        retVal+=1;
    }
    // read sessionNb
    {
        sessionNb=istream.readUI16();
        retVal+=2;
    }

    return retVal;
}
Esempio n. 4
0
int codeVersionTable1_3::read(DataInputStream&  istream ) { // throws IOException
    int retVal = 0;
    // read header
    retVal += header->read(istream);
    // read length
    {
        length=(istream.readUI8());
        retVal+=1;
    }
    // read configurationCountChange
    {
        configurationCountChange=(istream.readUI8());
        retVal+=1;
    }
    // read statusField
    {
        statusField=(istream.readUI8());
        retVal+=1;
    }
    // read pgmmsg
    for (; istream.available() > 0 ; ) {
        org_himalay_ccif_codeVersionTableMsg__PTR_TYPE temp;
        org_himalay_ccif_codeVersionTableMsg__NEW( temp);
        retVal += temp->read(istream);
        pgmmsg.add(temp);
    }
    // read bf1
    bf1= istream.readUI8();
    retVal += 1;
    // read statusfldInstance
    if (getDownload_type()==0x00) {
        org_himalay_ccif_codeVersionTable1_3_statusfld__NEW( statusfldInstance);
        statusfldInstance->parent=this;
        retVal += statusfldInstance->read(istream);
    }
    // read statusfld2Instance
    if (getDownload_type()==0x01) {
        org_himalay_ccif_codeVersionTable1_3_statusfld2__NEW( statusfld2Instance);
        statusfld2Instance->parent=this;
        retVal += statusfld2Instance->read(istream);
    }
    // read statusfld3Instance
    if (getDownload_type()==0x02) {
        org_himalay_ccif_codeVersionTable1_3_statusfld3__NEW( statusfld3Instance);
        statusfld3Instance->parent=this;
        retVal += statusfld3Instance->read(istream);
    }
    // read codeFileByte
    {
        retVal+=codeFileByte->read(istream);
    }
    // read codeVeriFicationCertiFication
    retVal += codeVeriFicationCertiFication->read(istream);

    return retVal;
}
Esempio n. 5
0
int DSG_packetError::readNoHeader(DataInputStream&  istream ) { // throws IOException
    int retVal = 0;

    // length
    {
        length=(istream.readUI8());
        retVal+=1;
    }
    // transaction_id
    {
        transaction_id=(istream.readUI8());
        retVal+=1;
    }
    return retVal;
}
Esempio n. 6
0
int CloseMmiCnf::readNoHeader(DataInputStream&  istream ) { // throws IOException
    int retVal = 0;

    // length
    {
        length=(istream.readUI8());
        retVal+=1;
    }
    // dialogNumber
    {
        dialogNumber=(istream.readUI8());
        retVal+=1;
    }
    return retVal;
}
Esempio n. 7
0
int dvbJapp_locator_descriptor::read(DataInputStream&  distream ) { // throws IOException
    int retVal = 0;
    int sizeLimit= desc_header->length + (0);
    ui8* ba        = new ui8[sizeLimit];
    distream.readFully(ba, 0, sizeLimit);
    ByteArrayDataInputStream istream(ba, 0, sizeLimit);
    {
        // read desc_header
        retVal += desc_header->read(istream);
        // read base_directory
        {
            retVal+=base_directory->read(istream);
        }
        // read class_path
        {
            retVal+=class_path->read(istream);
        }
        // read initial_class
        {
            retVal+=initial_class->read(istream);
        }
    }

    return retVal;
}
Esempio n. 8
0
int CloseMmiCnf::read(DataInputStream&  istream ) { // throws IOException
    int retVal = 0;
    // read header
    retVal += header->read(istream);
    // read length
    {
        length=(istream.readUI8());
        retVal+=1;
    }
    // read dialogNumber
    {
        dialogNumber=(istream.readUI8());
        retVal+=1;
    }

    return retVal;
}
Esempio n. 9
0
int HomingCancelled::readNoHeader(DataInputStream&  istream ) { // throws IOException
    int retVal = 0;

    // length
    {
        length=(istream.readUI8());
        retVal+=1;
    }
    return retVal;
}
Esempio n. 10
0
		void Engine::read_socket(DataInputStream & network_in)
		{
			if( BIO_pending(bioIn) > 64*1024 ) // Enough for 4 ssl packets
				return;
			Data data;
			if( network_in.read(data) == 0 )
				return;
			wLog("sock.read: %d", data.getSize());
			int len = BIO_write(bioIn, data.getData(), data.getSize()); // Consumes everything by docs
			wLog("BIO_write: %d", len);
		}
Esempio n. 11
0
int network_information_table_section::readNoHeader(DataInputStream&  istream ) { // throws IOException
    int retVal = 0;

    // bf2
    bf2= istream.readUI8();
    retVal += 1;
    // subtableInstance
    {
        ui8* ba= new ui8[tableHeader->getSection_length()+(-5)];
        int iCount = istream.read(ba,tableHeader->getSection_length()+(-5));
        ByteArrayDataInputStream* bais= new ByteArrayDataInputStream(ba,0,iCount );
        retVal += subtableInstance->read(*bais);
        delete bais;
    }
    // CRC
    {
        CRC=istream.readUI32() ;
        retVal+=4;
    }
    return retVal;
}
Esempio n. 12
0
int HomingCancelled::read(DataInputStream&  istream ) { // throws IOException
    int retVal = 0;
    // read header
    retVal += header->read(istream);
    // read length
    {
        length=(istream.readUI8());
        retVal+=1;
    }

    return retVal;
}
Esempio n. 13
0
int SoftwareVerReportS_Mode::read(DataInputStream&  istream ) { // throws IOException
    int retVal = 0;
    // read applicationsInReport
    for (; istream.available() > 0 ; ) {
        org_himalay_ccif_softwareVerSMsg__PTR_TYPE temp;
        org_himalay_ccif_softwareVerSMsg__NEW( temp);
        retVal += temp->read(istream);
        applicationsInReport.add(temp);
    }

    return retVal;
}
Esempio n. 14
0
int diagnosticReq_2_Smode::read(DataInputStream&  istream ) { // throws IOException
    int retVal = 0;
    // read length
    {
        length=(istream.readUI8());
        retVal+=1;
    }
    // read selfDiagnostics
    {
        retVal+=selfDiagnostics->read(istream);
    }

    return retVal;
}
Esempio n. 15
0
void SaveHandler::func_22150_b() 
{
        try
        {
            File file = new File(saveDirectory, "session.lock");
            DataInputStream datainputstream = new DataInputStream(new FileInputStream(file));
            try
            {
                if(datainputstream.readLong() != now)
                {
                    throw new MinecraftException("The save is being accessed from another location, aborting");
                }
            }
            ly
            {
                datainputstream.close();
            }
        }
        catch(IOException ioexception)
        {
            throw new MinecraftException("Failed to check session lock, aborting");
        }
}
Esempio n. 16
0
int HistoryReq::readNoHeader(DataInputStream&  istream ) { // throws IOException
    int retVal = 0;

    // length
    {
        length=(istream.readUI8());
        retVal+=1;
    }
    // pincodeLength
    {
        retVal+=pincodeLength->read(istream);
    }
    return retVal;
}
Esempio n. 17
0
int DescriptorCollection::read(DataInputStream&  istream ) { // throws IOException
    int retVal = 0;
    // read descriptor_count
    {
        descriptor_count=(istream.readUI8());
        retVal+=1;
    }
    // read descriptors
    for (int iIdx=0; iIdx <(descriptor_count + (0)); iIdx++) {
        org_himalay_si_SCTE65DescriptorFactory_SCTE65Descriptor__PTR_TYPE  temp;    /* Generic classes are abstract, so we can not invoke new*/    {
            int iHolder= 0;
            DataInputStream* disTemp = &istream;
            temp = SCTE65DescriptorFactory::createMsg(*disTemp,iHolder);
            retVal += iHolder;
        }
        descriptors.add(temp);
    }

    return retVal;
}
Esempio n. 18
0
int softwareVerMMsg::read(DataInputStream&  istream ) { // throws IOException
    int retVal = 0;
    // read ApplicationStatusflag
    {
        ApplicationStatusflag=(istream.readUI8());
        retVal+=1;
    }
    // read applicationNameByte
    {
        retVal+=applicationNameByte->read(istream);
    }
    // read applicationSignbyte
    {
        retVal+=applicationSignbyte->read(istream);
    }
    // read applicationVersionbyte
    {
        retVal+=applicationVersionbyte->read(istream);
    }

    return retVal;
}
Esempio n. 19
0
int main (int argc, char **argv) {
    if(isatty(STDIN_FILENO) && argc==1) {
      cout<<"No input data or parameters. Use -h,--help for more information"<<endl;
      exit(EXIT_FAILURE);
    }
	gengetopt_args_info args_info;
	TRY_EXCEPTION();
	if (cmdline_parser (argc, argv, &args_info) != 0)
		exit(EXIT_FAILURE);
#ifndef WITH_LIBXML
	if ( args_info.input_format_arg == input_format_arg_xml ) {
		cerr << "The software was built with WITH_LIBXML=OFF. Please rebuild it if you want XML functionality." << endl;
		exit(EXIT_FAILURE);
	}
#endif // WITH_LIBXML
	if ( args_info.print_relaxng_input_given && args_info.print_relaxng_output_given ) {
		cerr << "error: --print-relaxng-input and --print-relaxng-output can not be used at the same time" << endl;
		exit(EXIT_FAILURE);
	}
	if ( args_info.print_relaxng_input_given ) {
		cout << fastphylo_distance_matrix_xml_relaxngstr << std::endl;
		exit(EXIT_SUCCESS);
	};
	if ( args_info.print_relaxng_output_given ) {
		cout << fastphylo_tree_count_xml_relaxngstr << std::endl;
		exit(EXIT_SUCCESS);
	};
	//----------------------------------------------
	// DISTANCE METHODS
	std::vector<NJ_method> methods;
	if( args_info.number_of_runs_given && args_info.input_format_arg == input_format_arg_xml ) {
		cerr << "error: --number-of-runs can not be used together with input format xml." << endl;
		exit(EXIT_FAILURE);
	}
	switch ( args_info.method_arg ) {
	case method_arg_NJ:
		methods.push_back(NJ);
		break;
	case method_arg_FNJ:
		methods.push_back(FNJ);
		break;
	case method_arg_BIONJ:
		methods.push_back(BIONJ);
		break;
	default:
		cerr << "error: method chosen not available" << endl;
		exit(EXIT_FAILURE);
	}
	bool printCounts = args_info.print_counts_flag;
	try {
		char * inputfilename = NULL;
		char * outputfilename = NULL;
		DataInputStream *istream;
		DataOutputStream *ostream;

		switch( args_info.inputs_num ) {
			case 0:
				break; /* inputfilename will be null and indicate stdin as input */
		case 1:
			inputfilename =  args_info.inputs[0];
			break;
		default: cerr << "Error: you can at most specify one input filename" << endl;
			exit(EXIT_FAILURE);
		}
		if( args_info.outfile_given )
			outputfilename = args_info.outfile_arg;
		switch ( args_info.input_format_arg ) {
			case input_format_arg_phylip:
				istream = new PhylipDmInputStream(inputfilename);
				break;
			case input_format_arg_binary: istream = new BinaryInputStream(inputfilename);
				break;
#ifdef WITH_LIBXML
			case input_format_arg_xml: istream = new XmlInputStream(inputfilename);
				break;
#endif // WITH_LIBXML
			default:
				exit(EXIT_FAILURE);
		}
		switch (args_info.output_format_arg) {
			case output_format_arg_newick:
				ostream = new TreeTextOutputStream(outputfilename);
				break;
			case output_format_arg_xml:
				ostream = new XmlOutputStream(outputfilename);
				break;
			default:
				exit(EXIT_FAILURE);
		}
		//printf("%d\n", args_info.input_format_arg);
		// THE DATA WE WILL PROCESS
		vector<Sequence> seqs;
		vector<std::string> names;
		vector<DNA_b128_String> b128seqs;
		Extrainfos extrainfos;
		bool latestReadSuccessful = true;
		vector<string> speciesnames;
		readstatus status;
		int run = 0;
		status = END_OF_RUN;

		while (status == END_OF_RUN && (args_info.input_format_arg == input_format_arg_xml || run<args_info.number_of_runs_arg)) {
			string runId("");
			run++;
			tree2int_map tree2count((size_t)(args_info.bootstraps_arg * 1.3));
			str2int_hashmap name2id;
			if (args_info.input_format_arg==input_format_arg_binary) {
				StrFloMatrix dm;
				for (int runNo=1; (status = istream->readDM(dm, names, runId, extrainfos))==DM_READ; runNo++) {
					if (args_info.analyze_run_number_given) {
						if (runNo<args_info.analyze_run_number_arg)
							continue;
						if (runNo>args_info.analyze_run_number_arg) {
							status=END_OF_RUN;
							break;
							}
						}
					for(size_t namei=0; namei<dm.getSize(); namei++)
						name2id[dm.getIdentifier(namei)] = namei;
					buildTrees(dm, tree2count, methods,name2id);
				}
			}
			else {
				StrDblMatrix dm;
				for (int runNo=1; (status = istream->readDM(dm, names, runId, extrainfos))==DM_READ; runNo++) {
					if (args_info.analyze_run_number_given) {
						if (runNo<args_info.analyze_run_number_arg)
							continue;
						if (runNo>args_info.analyze_run_number_arg) {
							status=END_OF_RUN;
							break;
							}
						}
					for(size_t namei=0; namei<dm.getSize(); namei++) {
					     name2id[dm.getIdentifier(namei)] = namei;
					}
					buildTrees(dm, tree2count, methods,name2id);
				}
			}
			if (status==END_OF_RUN)
				ostream->print(tree2count,printCounts, runId, names, extrainfos);
			if (args_info.analyze_run_number_given)
				break;
		}//end run loop
		delete ostream;
		delete istream;
	}
	catch(...){
		throw;
	}
	CATCH_EXCEPTION();
	cmdline_parser_free(&args_info);
	return 0;
}