Examples of writeToStream()


Examples of com.webobjects.foundation.NSMutableData.writeToStream()

      theData.appendBytes(longToByteArray2(theTopObject, 8)); // _topObject appears to be set to 0 in CF
      theData.appendBytes(longToByteArray2(offsetTableStart, 8)); // _offsetTableOffset

      // write to stream
      try {
        theData.writeToStream(out);
      } catch (IOException e) {
        e.printStackTrace();
        throw new RuntimeException("Failed to write binary property list ", e);
      }
    }
View Full Code Here

Examples of de.hpi.eworld.visualizer.simulation.traci.common.Command.writeToStream()

      random.nextBytes(payload);
      Command command = new Command(0, payload);
     
      //serialize this command
      ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
      command.writeToStream(new DataOutputStream(outputStream));
      byte []commandBytes = outputStream.toByteArray();
     
      //read this command
      DataInputStream inputStream = new DataInputStream(new ByteArrayInputStream(commandBytes));
      Command decodedCommand = Command.readFromStream(inputStream);
View Full Code Here

Examples of de.hpi.eworld.visualizer.simulation.traci.common.Message.writeToStream()

   */
  public void subscribeToSimulationValues() throws Exception {
    SubscribeSimulationValueRetrivalCommandGenerator simulationValue = new SubscribeSimulationValueRetrivalCommandGenerator(
        ModelManager.getInstance().getSimulationStartTime() * 1000, ModelManager.getInstance().getSimulationEndTime() * 1000);
    Message message = new Message(simulationValue);
    message.writeToStream(this.outputStream);
    Message response = Message.readFromStream(this.inputStream);
    for (Command command:response.getCommands()) {
      switch(command.getId()) {
        case SubscribeSimulationValueRetrivalCommandGenerator.ID:
          ResponseCommandReader responseCommand = ResponseCommandReader.fromCommand(command);
View Full Code Here

Examples of de.hpi.eworld.visualizer.simulation.traci.common.Message.writeToStream()

   */
  private float[] subscribeToVehicleValues(String id, int startTime) throws IOException, TraciException {
    SubscribeVehicleValueRetrivalCommandGenerator vehicleValue = new SubscribeVehicleValueRetrivalCommandGenerator(
        startTime, ModelManager.getInstance().getSimulationEndTime() * 1000, id);
    Message request = new Message(vehicleValue);
    request.writeToStream(this.outputStream);
    Message response = Message.readFromStream(this.inputStream);
    float[] position = null;
    for (Command command:response.getCommands()) {
      switch(command.getId()) {
        case SubscribeVehicleValueRetrivalCommandGenerator.ID:
View Full Code Here

Examples of de.hpi.eworld.visualizer.simulation.traci.common.Message.writeToStream()

    // 1 time step = 1000 steps in sumo
    if(!readOnly) {
      this.time = time;
      SimulationStepCommandGenerator2 simulationStep = new SimulationStepCommandGenerator2(time * 1000);
      Message message = new Message(simulationStep);
      message.writeToStream(this.outputStream);
    }
   
    Map<String, double[]> added = new HashMap<String, double[]>();
    Map<String, double[]> updated = new HashMap<String, double[]>();
    List<String> removed = new ArrayList<String>();
View Full Code Here

Examples of de.hpi.eworld.visualizer.simulation.traci.common.Message.writeToStream()

   *             Communication Error.
   */
  public void closeConnection() throws IOException {
   
    Message message = new Message(new CloseCommandGenerator());
    message.writeToStream(this.outputStream);
   
    while(true) {
      message = Message.readFromStream(this.inputStream);
      for(Command command : message.getCommands()) {
        if(command.getId() ==  CloseCommandGenerator.ID) {
View Full Code Here

Examples of de.unigoettingen.sub.commons.contentlib.imagelib.JpegInterpreter.writeToStream()

            logger.trace("ri");
            JpegInterpreter pi = new JpegInterpreter(ri);
            logger.trace("pi");
            FileOutputStream outputFileStream = new FileOutputStream(outFileName);
            logger.trace("output");
            pi.writeToStream(null, outputFileStream);
            logger.trace("write stream");
            outputFileStream.close();
            logger.trace("close stream");
        } else {
            String cs = ConfigMain.getParameter("goobiContentServerUrl") + inFileName + "&scale=" + tmpSize + "&rotate=" + intRotation + "&format=jpg";
View Full Code Here

Examples of org.activemq.util.BitArray.writeToStream()

        ba.set(ActiveMQMessage.MESSAGE_PART_INDEX,msg.isMessagePart());
        ba.set(ActiveMQMessage.CACHED_VALUES_INDEX, cachingEnabled);
        ba.set(ActiveMQMessage.CACHED_DESTINATION_INDEX,cachingDestination);
        ba.set(ActiveMQMessage.LONG_SEQUENCE_INDEX, longSequence);
       
        ba.writeToStream(dataOut);
        if (msg.isReceiptRequired()){
            dataOut.writeShort(msg.getId());
        }
        if (msg.isExternalMessageId()){
            writeUTF(msg.getJMSMessageID(),dataOut);
View Full Code Here

Examples of org.activemq.util.BitArray.writeToStream()

        BitArray ba = packet.getBitArray();
        ba.set(AbstractPacket.RECEIPT_REQUIRED_INDEX, packet.isReceiptRequired());
        Object[] visited = packet.getBrokersVisited();
        boolean writeVisited = visited != null && visited.length > 0;
        ba.set(AbstractPacket.BROKERS_VISITED_INDEX,writeVisited);
        ba.writeToStream(dataOut);
        if (writeVisited){
            dataOut.writeShort(visited.length);
            for(int i =0; i < visited.length; i++){
                dataOut.writeUTF(visited[i].toString());
            }
View Full Code Here

Examples of org.activemq.util.BitArray.writeToStream()

        BitArray ba = packet.getBitArray();
        ba.set(AbstractPacket.RECEIPT_REQUIRED_INDEX, packet.isReceiptRequired());
        Object[] visited = packet.getBrokersVisited();
        boolean writeVisited = visited != null && visited.length > 0;
        ba.set(AbstractPacket.BROKERS_VISITED_INDEX,writeVisited);
        ba.writeToStream(dataOut);
        if (writeVisited){
            dataOut.writeShort(visited.length);
            for(int i =0; i < visited.length; i++){
                dataOut.writeUTF(visited[i].toString());
            }
View Full Code Here
TOP
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.