public void a(DataOutput dataoutput) {
   dataoutput.writeInt(this.a);
   dataoutput.writeShort(this.b);
   dataoutput.writeInt(this.c);
   dataoutput.writeByte((byte) this.d);
   a(this.e, dataoutput);
 }
示例#2
0
  public void writeObject(DataOutput out) throws IOException {
    super.writeObject(out);

    scope = new int[((Light) node).numScopes()];
    for (int i = 0; i < ((Light) node).numScopes(); i++) {
      scope[i] = control.getSymbolTable().addReference(((Light) node).getScope(i));
      ;
    }
    boundingLeaf =
        control.getSymbolTable().addReference(((Light) node).getInfluencingBoundingLeaf());

    Color3f color = new Color3f();
    ((Light) node).getColor(color);
    control.writeColor3f(out, color);

    out.writeBoolean(((Light) node).getEnable());

    out.writeInt(boundingLeaf);
    control.writeBounds(out, ((Light) node).getInfluencingBounds());

    out.writeInt(scope.length);
    for (int i = 0; i < scope.length; i++) {
      out.writeInt(scope[i]);
    }
  }
  private static void writeWatchableObject(
      DataOutput par0DataOutput, WatchableObject par1WatchableObject) throws IOException {
    int i =
        (par1WatchableObject.getObjectType() << 5 | par1WatchableObject.getDataValueId() & 31)
            & 255;
    par0DataOutput.writeByte(i);

    switch (par1WatchableObject.getObjectType()) {
      case 0:
        par0DataOutput.writeByte(((Byte) par1WatchableObject.getObject()).byteValue());
        break;
      case 1:
        par0DataOutput.writeShort(((Short) par1WatchableObject.getObject()).shortValue());
        break;
      case 2:
        par0DataOutput.writeInt(((Integer) par1WatchableObject.getObject()).intValue());
        break;
      case 3:
        par0DataOutput.writeFloat(((Float) par1WatchableObject.getObject()).floatValue());
        break;
      case 4:
        Packet.writeString((String) par1WatchableObject.getObject(), par0DataOutput);
        break;
      case 5:
        ItemStack itemstack = (ItemStack) par1WatchableObject.getObject();
        Packet.writeItemStack(itemstack, par0DataOutput);
        break;
      case 6:
        ChunkCoordinates chunkcoordinates = (ChunkCoordinates) par1WatchableObject.getObject();
        par0DataOutput.writeInt(chunkcoordinates.posX);
        par0DataOutput.writeInt(chunkcoordinates.posY);
        par0DataOutput.writeInt(chunkcoordinates.posZ);
    }
  }
示例#4
0
  @Override
  public void writeToDataOutput(DataOutput write) throws IOException {
    write.writeUTF(buildVersion);
    write.writeInt(gameId);
    write.writeUTF(guid);
    write.writeUTF(password);
    write.writeUTF(secret);
    write.writeInt(keyTime);

    if (key != null) {
      write.writeShort(key.length);
      write.write(key);
    } else {
      write.writeShort(0);
    }

    if (unkStr != null) {
      byte[] buf = unkStr.getBytes("UTF-8");
      write.writeInt(buf.length);
      write.write(buf);
    } else {
      write.writeInt(0);
    }

    write.writeUTF(pk);
    write.writeUTF(Tq);
    write.writeUTF(H);
    write.writeUTF(playPlatform);
  }
示例#5
0
  public void serialize(RangeSliceCommand sliceCommand, DataOutput dos, int version)
      throws IOException {
    dos.writeUTF(sliceCommand.keyspace);
    dos.writeUTF(sliceCommand.column_family);
    ByteBuffer sc = sliceCommand.super_column;
    dos.writeInt(sc == null ? 0 : sc.remaining());
    if (sc != null) ByteBufferUtil.write(sc, dos);

    TSerializer ser = new TSerializer(new TBinaryProtocol.Factory());
    FBUtilities.serialize(ser, sliceCommand.predicate, dos);

    if (version >= MessagingService.VERSION_11) {
      if (sliceCommand.row_filter == null) {
        dos.writeInt(0);
      } else {
        dos.writeInt(sliceCommand.row_filter.size());
        for (IndexExpression expr : sliceCommand.row_filter) FBUtilities.serialize(ser, expr, dos);
      }
    }
    AbstractBounds.serializer().serialize(sliceCommand.range, dos, version);
    dos.writeInt(sliceCommand.maxResults);
    if (version >= MessagingService.VERSION_11) {
      dos.writeBoolean(sliceCommand.maxIsColumns);
      dos.writeBoolean(sliceCommand.isPaging);
    }
  }
示例#6
0
  /** Write the actual data contents of the tag, implemented in NBT extension classes */
  void write(DataOutput output) throws IOException {
    output.writeInt(this.intArray.length);

    for (int var2 = 0; var2 < this.intArray.length; ++var2) {
      output.writeInt(this.intArray[var2]);
    }
  }
 @Override
 public void write(DataOutput out) throws IOException {
   out.writeInt(tuple.size());
   for (Integer entry : tuple) {
     out.writeInt(entry);
   }
 }
示例#8
0
  private void dumpBinary(DirectedGraph graph, DataOutput os) throws IOException {
    try {
      int numLeafNodes = setUniqueLeafNodeIds(graph);
      int numDecNodes = setUniqueDecisionNodeIds(graph);
      int numGraphNodes = setUniqueDirectedGraphNodeIds(graph);
      int maxNum = 1 << 30;
      if (numLeafNodes > maxNum || numDecNodes > maxNum || numGraphNodes > maxNum) {
        throw new UnsupportedOperationException(
            "Cannot write more than " + maxNum + " nodes of one type in this format");
      }
      // write the number of decision nodes
      os.writeInt(numDecNodes);
      printDecisionNodes(graph, os, null);

      // write the number of leaves.
      os.writeInt(numLeafNodes);
      printLeafNodes(graph, os, null);

      // write the number of directed graph nodes
      os.writeInt(numGraphNodes);
      printDirectedGraphNodes(graph, os, null);

    } catch (IOException ioe) {
      IOException newIOE = new IOException("Error dumping CART to output stream");
      newIOE.initCause(ioe);
      throw newIOE;
    }
  }
  /** Write the booleans that this object uses to a BooleanStream */
  public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut)
      throws IOException {

    ConsumerInfo info = (ConsumerInfo) o;

    super.looseMarshal(wireFormat, o, dataOut);
    looseMarshalCachedObject(wireFormat, (DataStructure) info.getConsumerId(), dataOut);
    dataOut.writeBoolean(info.isBrowser());
    looseMarshalCachedObject(wireFormat, (DataStructure) info.getDestination(), dataOut);
    dataOut.writeInt(info.getPrefetchSize());
    dataOut.writeInt(info.getMaximumPendingMessageLimit());
    dataOut.writeBoolean(info.isDispatchAsync());
    looseMarshalString(info.getSelector(), dataOut);
    looseMarshalString(info.getSubscriptionName(), dataOut);
    dataOut.writeBoolean(info.isNoLocal());
    dataOut.writeBoolean(info.isExclusive());
    dataOut.writeBoolean(info.isRetroactive());
    dataOut.writeByte(info.getPriority());
    looseMarshalObjectArray(wireFormat, info.getBrokerPath(), dataOut);
    looseMarshalNestedObject(wireFormat, (DataStructure) info.getAdditionalPredicate(), dataOut);
    dataOut.writeBoolean(info.isNetworkSubscription());
    dataOut.writeBoolean(info.isOptimizedAcknowledge());
    dataOut.writeBoolean(info.isNoRangeAcks());
    looseMarshalObjectArray(wireFormat, info.getNetworkConsumerPath(), dataOut);
  }
  /**
   * Write a object instance to data output stream
   *
   * @param o the instance to be marshaled
   * @param dataOut the output stream
   * @throws IOException thrown if an error occurs
   */
  public void tightMarshal2(
      OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs)
      throws IOException {
    super.tightMarshal2(wireFormat, o, dataOut, bs);

    ConsumerInfo info = (ConsumerInfo) o;
    tightMarshalCachedObject2(wireFormat, (DataStructure) info.getConsumerId(), dataOut, bs);
    bs.readBoolean();
    tightMarshalCachedObject2(wireFormat, (DataStructure) info.getDestination(), dataOut, bs);
    dataOut.writeInt(info.getPrefetchSize());
    dataOut.writeInt(info.getMaximumPendingMessageLimit());
    bs.readBoolean();
    tightMarshalString2(info.getSelector(), dataOut, bs);
    tightMarshalString2(info.getSubscriptionName(), dataOut, bs);
    bs.readBoolean();
    bs.readBoolean();
    bs.readBoolean();
    dataOut.writeByte(info.getPriority());
    tightMarshalObjectArray2(wireFormat, info.getBrokerPath(), dataOut, bs);
    tightMarshalNestedObject2(
        wireFormat, (DataStructure) info.getAdditionalPredicate(), dataOut, bs);
    bs.readBoolean();
    bs.readBoolean();
    bs.readBoolean();
    tightMarshalObjectArray2(wireFormat, info.getNetworkConsumerPath(), dataOut, bs);
  }
  /**
   * Description of the Method
   *
   * @param os Description of the Parameter
   * @param clientVersionNo Description of the Parameter
   * @exception java.io.IOException Description of the Exception
   */
  public void toStream(java.io.DataOutput os, int clientVersionNo) throws java.io.IOException {
    super.toStream(os, clientVersionNo);

    writeUTF(os, m_appContext);

    int size = m_vecOfContextsCarriedFwd.size();

    os.writeInt(size);

    Enumeration enu = m_vecOfContextsCarriedFwd.elements();

    while (enu.hasMoreElements()) {
      DmiSourceContext context = (DmiSourceContext) enu.nextElement();

      context.toStream(os, clientVersionNo);
    }

    if (clientVersionNo <= 3000) return;

    os.writeInt(m_hashCarryFwdProps.size());

    Enumeration keys = m_hashCarryFwdProps.keys();

    while (keys.hasMoreElements()) {
      String key = (String) keys.nextElement();
      String value = (String) m_hashCarryFwdProps.get(key);

      writeUTF(os, key);
      writeUTF(os, value);
    }
  }
示例#12
0
 /**
  * Write a Map<String, Integer>
  *
  * @param out DataOutput
  * @param map Map to write
  * @throws IOException I/O errors
  */
 public static void writeStrIntMap(DataOutput out, Map<String, Integer> map) throws IOException {
   out.writeInt(map.size());
   for (Map.Entry<String, Integer> entry : map.entrySet()) {
     WritableUtils.writeString(out, entry.getKey());
     out.writeInt(entry.getValue());
   }
 }
  void writeData(DataOutput out) throws IOException {
    out.writeInt(rowIndices.size());
    if (rowIndices.size() > 0) {
      int n = rowIndices.get(0).length;
      out.writeInt(n);

      if (this.useDictionary == true) {
        dict.write(out);
        for (int i = 0; i < rowIndices.size(); i++) {
          int[] row = rowIndices.get(i);
          for (int j = 0; j < n; j++) {
            out.writeInt(row[j]);
          }
        }

      } else {
        for (int i = 0; i < rowIndices.size(); i++) {
          int[] row = rowIndices.get(i);
          for (int j = 0; j < n; j++) {
            out.writeUTF(dict.getValueFromId(row[j]));
          }
        }
      }
    }
  }
 @Override
 public void toData(DataOutput out) throws IOException {
   super.toData(out);
   out.writeByte(this.attributeCode);
   out.writeInt(this.newValue);
   out.writeInt(this.cacheId);
 }
示例#15
0
  /** Write the actual data contents of the tag, implemented in NBT extension classes */
  void write(DataOutput p_74734_1_) throws IOException {
    p_74734_1_.writeInt(this.intArray.length);

    for (int var2 = 0; var2 < this.intArray.length; ++var2) {
      p_74734_1_.writeInt(this.intArray[var2]);
    }
  }
示例#16
0
 @Override
 public void write(DataOutput out) throws IOException {
   out.writeInt(VERSION);
   out.writeInt(byteSize);
   out.writeInt(hashCount);
   out.writeInt(keyCount.intValue());
 }
示例#17
0
 /**
  * Serializes this object.
  *
  * @param out where to write the raw byte representation
  */
 public void write(DataOutput out) throws IOException {
   int size = size();
   out.writeInt(size);
   for (int i = 0; i < size; i++) {
     out.writeInt(get(i));
   }
 }
 @Override
 public void toData(DataOutput out) throws IOException {
   super.toData(out);
   out.writeInt(this.prId);
   out.writeInt(this.processorId);
   DataSerializer.writeObject(this.profiles, out);
 }
示例#19
0
  /**
   * The object implements the writeTo method to save its contents by calling the methods of
   * DataOutput for its primitive values and strings or calling the writeTo method for other
   * objects.
   *
   * @param out the stream to write the object to.
   * @throws IOException Includes any I/O exceptions that may occur.
   */
  public void writeTo(DataOutput out) throws IOException {
    out.writeInt(schemaId);

    out.writeInt(ids.length);

    for (Integer id : ids) out.writeInt(id);
  }
  /**
   * DO NOT call symbolTable.addReference in writeObject as this (may) result in a
   * concurrentModificationException.
   *
   * <p>All references should be created in the constructor
   */
  public void writeObject(DataOutput out) throws IOException {
    boolean sgIO = node instanceof com.sun.j3d.utils.scenegraph.io.SceneGraphIO;
    out.writeBoolean(sgIO);
    out.writeInt(symbol.nodeID);

    int nodeClassID = control.getNodeClassID(node);

    out.writeShort(nodeClassID);

    if (nodeClassID == -1) out.writeUTF(nodeClassName);

    writeConstructorParams(out);

    if (sgIO) {
      ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
      DataOutputStream tmpOut = new DataOutputStream(byteStream);
      ((com.sun.j3d.utils.scenegraph.io.SceneGraphIO) node).writeSceneGraphObject(tmpOut);
      tmpOut.close();
      out.writeInt(byteStream.size());
      out.write(byteStream.toByteArray());
    }

    writeUserData(out);
    writeString(node.getName(), out);

    writeCapabilities(out);
  }
示例#21
0
  @Override
  public void write(DataOutput dOut) throws IOException {
    dOut.writeUTF(instanceId);

    // Hadoop Configuration has to get its act right
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    conf.writeXml(baos);
    baos.close();
    byte[] array = baos.toByteArray();
    dOut.writeInt(array.length);
    dOut.write(array);

    def.write(dOut);
    dOut.writeUTF(status.toString());
    dOut.writeInt(executionPaths.size());
    for (Map.Entry<String, NodeInstance> entry : executionPaths.entrySet()) {
      dOut.writeUTF(entry.getKey());
      dOut.writeUTF(entry.getValue().nodeName);
      dOut.writeBoolean(entry.getValue().started);
    }
    dOut.writeInt(persistentVars.size());
    for (Map.Entry<String, String> entry : persistentVars.entrySet()) {
      dOut.writeUTF(entry.getKey());
      writeStringAsBytes(entry.getValue(), dOut);
    }
  }
示例#22
0
 public void a(DataOutput dataoutput) {
   dataoutput.write(this.e);
   dataoutput.writeInt(this.a);
   dataoutput.write(this.b);
   dataoutput.writeInt(this.c);
   dataoutput.write(this.face);
 }
示例#23
0
 public void writeTo(DataOutput out) throws IOException {
   out.writeByte(mode);
   out.writeInt(x);
   out.writeInt(y);
   out.writeInt(r);
   out.writeInt(g);
   out.writeInt(b);
 }
 @Override
 public void write(DataOutput out) throws IOException {
   out.writeInt(neighbors.size());
   IntIterator neighborsIt = neighbors.iterator();
   while (neighborsIt.hasNext()) {
     out.writeInt(neighborsIt.nextInt());
   }
 }
 public void serialize(IndexSummary t, DataOutput out) throws IOException {
   out.writeInt(DatabaseDescriptor.getIndexInterval());
   out.writeInt(t.keys.length);
   for (int i = 0; i < t.keys.length; i++) {
     out.writeLong(t.getPosition(i));
     ByteBufferUtil.writeWithLength(t.keys[i], out);
   }
 }
示例#26
0
 private void writeDirectColorModel(DataOutput out, DirectColorModel colorModel)
     throws IOException {
   out.writeInt(colorModel.getPixelSize());
   out.writeInt(colorModel.getRedMask());
   out.writeInt(colorModel.getGreenMask());
   out.writeInt(colorModel.getBlueMask());
   out.writeInt(colorModel.getAlphaMask());
 }
示例#27
0
 protected void writeConstructorParams(DataOutput out) throws IOException {
   super.writeConstructorParams(out);
   out.writeInt(((ImageComponent) node).getFormat());
   out.writeInt(((ImageComponent) node).getHeight());
   out.writeInt(((ImageComponent) node).getWidth());
   out.writeBoolean(((ImageComponent) node).isByReference());
   out.writeBoolean(((ImageComponent) node).isYUp());
 }
示例#28
0
 @Override
 public void write(DataOutput stream) throws IOException {
   stream.writeInt(9 + block.length);
   stream.writeByte(Message.PIECE);
   stream.writeInt(index);
   stream.writeInt(begin);
   stream.write(block);
 }
示例#29
0
 @Override
 public void write(DataOutput out) throws IOException {
   out.writeInt(serializedEdgesBytesUsed);
   if (serializedEdgesBytesUsed > 0) {
     out.write(serializedEdges, 0, serializedEdgesBytesUsed);
   }
   out.writeInt(edgeCount);
 }
示例#30
0
 public void writeConstructorParams(DataOutput out) throws IOException {
   super.writeConstructorParams(out);
   out.writeInt(((Texture) node).getMipMapMode());
   out.writeInt(((Texture) node).getWidth());
   out.writeInt(((Texture) node).getHeight());
   out.writeInt(((Texture) node).getFormat());
   out.writeInt(((Texture) node).getBoundaryWidth());
 }