Writes just the scene data which is handy for derived classes which
may wish to add their own scene data to the scene output.
163405
protected void writeSceneData (SparseMisoSceneModel model,
                                   DataWriter writer)
        throws SAXException
    {
        writer.dataElement("swidth", Integer.toString(model.swidth));
        writer.dataElement("sheight", Integer.toString(model.sheight));
        writer.dataElement("defTileSet", Integer.toString(model.defTileSet));

        writer.startElement("sections");
        for (Iterator<Section> iter = model.getSections(); iter.hasNext(); ) {
            Section sect = iter.next();
            if (sect.isBlank()) {
                continue;
            }
            AttributesImpl attrs = new AttributesImpl();
            attrs.addAttribute("", "x", "", "", String.valueOf(sect.x));
            attrs.addAttribute("", "y", "", "", String.valueOf(sect.y));
            attrs.addAttribute("", "width", "", "", String.valueOf(sect.width));
            writer.startElement("", "section", "", attrs);

            writer.dataElement(
                "base", StringUtil.toString(sect.baseTileIds, "", ""));

            // write our uninteresting object tile information
            writer.startElement("objects");
            for (int ii = 0; ii < sect.objectTileIds.length; ii++) {
                attrs = new AttributesImpl();
                attrs.addAttribute("", "tileId", "", "",
                                   String.valueOf(sect.objectTileIds[ii]));
                attrs.addAttribute("", "x", "", "",
                                   String.valueOf(sect.objectXs[ii]));
                attrs.addAttribute("", "y", "", "",
                                   String.valueOf(sect.objectYs[ii]));
                writer.emptyElement("", "object", "", attrs);
            }

            // write our interesting object tile information
            for (ObjectInfo element : sect.objectInfo) {
                writeInterestingObject(element, writer);
            }
            writer.endElement("objects");
            writer.endElement("section");
        }
        writer.endElement("sections");
    }
390350
private void writeObject(ObjectOutputStream out) throws IOException {
		// serialize the parent fields and the final fields
		out.defaultWriteObject();

		// the job conf knows how to serialize itself
		jobConf.write(out);

		// write the input split
		hadoopInputSplit.write(out);
	}
605039
def save(self_or_cls, obj, basename, fmt='auto', key={}, info={}, options=None, **kwargs):
        
        if info or key:
            raise Exception('Renderer does not support saving metadata to file.')

        if isinstance(obj, (Plot, NdWidget)):
            plot = obj
        else:
            with StoreOptions.options(obj, options, **kwargs):
                plot = self_or_cls.get_plot(obj)

        if (fmt in list(self_or_cls.widgets.keys())+['auto']) and len(plot) > 1:
            with StoreOptions.options(obj, options, **kwargs):
                if isinstance(basename, basestring):
                    basename = basename+'.html'
                self_or_cls.export_widgets(plot, basename, fmt)
            return

        rendered = self_or_cls(plot, fmt)
        if rendered is None: return
        (data, info) = rendered
        encoded = self_or_cls.encode(rendered)
        prefix = self_or_cls._save_prefix(info['file-ext'])
        if prefix:
            encoded = prefix + encoded
        if isinstance(basename, (BytesIO, StringIO)):
            basename.write(encoded)
            basename.seek(0)
        else:
            filename ='%s.%s' % (basename, info['file-ext'])
            with open(filename, 'wb') as f:
                f.write(encoded)
1104711
@Override
    public void write(DataOutput out) throws IOException
    {
        addSignatureIfNeed();
        out.writeInt(magic);
        out.writeShort(minor_version);
        out.writeShort(major_version);
        out.writeShort(constant_pool.size()+1);
        for (ConstantInfo ci : constant_pool)
        {
            ci.write(out);
        }
        int modifier = ClassFlags.getModifier(getModifiers());
        modifier |= ClassFlags.ACC_SYNTHETIC | ClassFlags.ACC_PUBLIC | ClassFlags.ACC_SUPER;
        out.writeShort(modifier);
        out.writeShort(this_class);
        out.writeShort(super_class);
        out.writeShort(interfaces.size());
        for (int ii : interfaces)
        {
            out.writeShort(ii);
        }
        out.writeShort(fields.size());
        for (FieldInfo fi : fields)
        {
            fi.write(out);
        }
        out.writeShort(methods.size());
        for (MethodInfo mi : methods)
        {
            mi.write(out);
        }
        out.writeShort(attributes.size());
        for (AttributeInfo ai : attributes)
        {
            ai.write(out);
        }

    }
147034
void write(ByteCodeWriter out)
    throws IOException
  {
    out.write(ConstantPool.CP_FLOAT);
    out.writeFloat(_value);
  }
347573
function writePixels() {
    var myencoder = new LZWEncoder(width, height, indexedPixels, colorDepth);
    myencoder.encode(out);
  }
592100
private void writeObject(final java.io.ObjectOutputStream out)
            throws IOException {
        out.writeBoolean(level instanceof UtilLoggingLevel);
        out.writeInt(level.toInt());
    }
821454
private void writeSimple(Class<?> declaredType, Object value) throws IOException {
        Class<?> realType = value.getClass();
        if (realType == Integer.class) {
            output.writeInt(((Integer) value).intValue());
        } else if (realType == Long.class) {
            output.writeLong(((Long) value).longValue());
        } else if (realType == Short.class) {
            output.writeInt(((Short) value).shortValue());
        } else if (realType == Byte.class) {
            output.writeInt(((Byte) value).byteValue());
        } else if (realType == Float.class) {
            float flt = ((Float) value).floatValue();
            if (Float.isNaN(flt)) {
                // write as string
                output.writeNull();
            } else if (Float.isInfinite(flt)) {
                // write as string
                output.writeString(Float.toString(flt));
            } else {
                output.writeFloat(flt);
            }
        } else if (realType == Double.class) {
            double dbl = ((Double) value).doubleValue();
            if (Double.isNaN(dbl)) {
                // write as string
                output.writeNull();
            } else if (Double.isInfinite(dbl)) {
                // write as string
                output.writeString(Double.toString(dbl));
            } else {
                output.writeDouble(dbl);
            }
        } else if (realType == Boolean.class) {
            output.writeBoolean(((Boolean) value).booleanValue());
        } else {
            // write as a string
            try {
                String converted = settings.getConverter().convertToString(realType, value);
                if (converted == null) {
                    throw new IllegalArgumentException("Unable to write because converter returned a null string: " + value);
                }
                output.writeString(converted);
            } catch (RuntimeException ex) {
                throw new IllegalArgumentException(
                        "Unable to convert type " + declaredType.getName() + " for real type: " + realType.getName(), ex);
            }
        }
    }
1146696
def write_data(self, write_finished_cb):
        """"""
        self._write_finished_cb = write_finished_cb
        data = bytearray()
        for led in self.leds:
            # In order to fit all the LEDs in one radio packet RGB565 is used
            # to compress the colors. The calculations below converts 3 bytes
            # RGB into 2 bytes RGB565. Then shifts the value of each color to
            # LSB, applies the intensity and shifts them back for correct
            # alignment on 2 bytes.
            R5 = ((int)((((int(led.r) & 0xFF) * 249 + 1014) >> 11) & 0x1F) *
                  led.intensity / 100)
            G6 = ((int)((((int(led.g) & 0xFF) * 253 + 505) >> 10) & 0x3F) *
                  led.intensity / 100)
            B5 = ((int)((((int(led.b) & 0xFF) * 249 + 1014) >> 11) & 0x1F) *
                  led.intensity / 100)
            tmp = (int(R5) << 11) | (int(G6) << 5) | (int(B5) << 0)
            data += bytearray((tmp >> 8, tmp & 0xFF))
        self.mem_handler.write(self, 0x00, data, flush_queue=True)
446293
public void write(DataOutput out) throws IOException {
        if (array == null) {
            out.write(NDARRAY_SER_VERSION_HEADER_NULL);
            return;
        }

        INDArray toWrite;
        if (array.isView()) {
            toWrite = array.dup();
        } else {
            toWrite = array;
        }

        //Write version header: this allows us to maintain backward compatibility in the future,
        // with features such as compression, sparse arrays or changes on the DataVec side
        out.write(NDARRAY_SER_VERSION_HEADER);
        Nd4j.write(toWrite, new DataOutputStream(new DataOutputWrapperStream(out)));
    }
1066238
private void writeObject(java.io.ObjectOutputStream s)
            throws java.io.IOException {
        s.defaultWriteObject();

        // Write out size
        s.writeInt(size());

        // Write out elements in order.
        int mask = elements.length - 1;
        for (int i = head; i != tail; i = (i + 1) & mask)
            s.writeObject(elements[i]);
    }
451923
public void writeFileMakeViews()
    {
        if (this.readThisMethod("makeScreen"))
        {
            this.writeThisMethod(CodeType.THICK);
            return;     // if no views specified, use default methods
        }
        
        if (true)
        {
            ClassInfo recClassInfo = (ClassInfo)this.getMainRecord();
            ClassFields recClassFields = new ClassFields(this);
            recClassFields.addListener(new SubFileFilter(ClassFields.CLASS_INFO_CLASS_NAME_KEY, recClassInfo.getField(ClassInfo.CLASS_NAME)));   // Only read through the class fields
            recClassFields.close();
            try {
                boolean firstTime = true;
                while (recClassFields.hasNext())
                {
                    recClassFields.next();
                    String strClassFieldType = recClassFields.getField(ClassFields.CLASS_FIELDS_TYPE).toString();
                    if (strClassFieldType.equalsIgnoreCase(ClassFieldsTypeField.SCREEN_CLASS_NAME))
                    {
                        if (firstTime)
                        {
                            this.writeMethodInterface(null, "makeScreen", "ScreenParent", "ScreenLoc itsLocation, ComponentParent parentScreen, int iDocMode, Map<String,Object> properties", "", "Make a default screen.", null);
                            m_StreamOut.writeit("\tScreenParent screen = null;\n");
                        }
                        String screenMode = recClassFields.getField(ClassFields.CLASS_FIELD_INITIAL_VALUE).toString();
                        if ((screenMode == null) || (screenMode.length() == 0))
                            screenMode = "MAINT_MODE";
                        if (!screenMode.contains("."))
                            screenMode = "ScreenConstants." + screenMode;
                        String fieldName = recClassFields.getField(ClassFields.CLASS_FIELD_NAME).toString();
                        if (firstTime)
                            m_StreamOut.writeit("\t");
                        else
                            m_StreamOut.writeit("\telse ");
                        m_StreamOut.write("if ((iDocMode & " + screenMode + ") == " + screenMode + ")\n");
                        m_StreamOut.writeit("\t\tscreen = Record.makeNewScreen(" + fieldName + ", itsLocation, parentScreen, iDocMode | ScreenConstants.DONT_DISPLAY_FIELD_DESC, properties, this, true);\n");
                        firstTime = false;
                    }
                }
                if (!firstTime)
                {
                    m_StreamOut.writeit("\telse\n");
                    m_StreamOut.writeit("\t\tscreen = super.makeScreen(itsLocation, parentScreen, iDocMode, properties);\n");
                    m_StreamOut.writeit("\treturn screen;\n}\n");                    
                }
            } catch (DBException e) {
                e.printStackTrace();
            }
        }
    }
169046
function SceneNode(gl) {
  this._children = [];
  this._visible = true;
  this._name = name || '';
  this._gl = gl;
  this._order = 1;
}
997773
public static void write (SimpleMisoSceneModel model, Json.Writer out) {
        out.object(); // outer
        out.value("width", model.width);
        out.value("height", model.height);
        out.value("viewwidth", model.vwidth);
        out.value("viewheight", model.vheight);

        out.array("base");
        for (int tileId : model.baseTileIds) out.value(tileId);
        out.end();

        out.array("objects");
        for (int ii = 0; ii < model.objectTileIds.length; ii++) {
            out.object();
            out.value("tileId", model.objectTileIds[ii]);
            out.value("x", model.objectXs[ii]);
            out.value("y", model.objectYs[ii]);
            out.end();
        }
        for (ObjectInfo info : model.objectInfo) {
            out.object();
            out.value("tileId", info.tileId);
            out.value("x", info.x);
            out.value("y", info.y);
            if (info.action != null) out.value("action", info.action);
            if (info.priority != 0) out.value("priority", info.priority);
            if (info.sx != 0 || info.sy != 0) {
                out.value("sx", info.sx);
                out.value("sy", info.sy);
                out.value("sorient", info.sorient);
            }
            if (info.zations != 0) out.value("zations", info.zations);
        }
        out.end(); // objects
        out.end(); // outer
    }
180314
private Object writeSimple(Class<?> declaredType, Object value) {
        Class<?> realType = value.getClass();
        if (realType == Integer.class || realType == Long.class || realType == Short.class ||
                realType == Byte.class || realType == Float.class || realType == Double.class ||
                realType == Boolean.class) {
            return value;
        } else {
            // write as a string
            try {
                String converted = settings.getConverter().convertToString(realType, value);
                if (converted == null) {
                    throw new IllegalArgumentException("Unable to write because converter returned a null string: " + value);
                }
                return converted;
            } catch (RuntimeException ex) {
                throw new IllegalArgumentException(
                        "Unable to convert type " + declaredType.getName() + " for real type: " + realType.getName(), ex);
            }
        }
    }
528248
public function write() : void
    {
        if (!$this->features) {
            return;
        }
        $i = 0;
        while (true) {
            $file = sprintf('%s/%s%s.php', $this->config->output, $this->normalize($this->objectUnderTest->getName()), $i ? ".$i" : '');
            if (!file_exists($file)) {
                break;
            }
            ++$i;
        }
        file_put_contents($file, $this->render());
    }
100540
function writeImageDesc() {

    out.writeByte(0x2c); // image separator
    WriteShort(0); // image position x,y = 0,0
    WriteShort(0);
    WriteShort(width); // image size
    WriteShort(height);

    // packed fields
    if (firstFrame) {
      // no LCT - GCT is used for first (or only) frame
      out.writeByte(0);
    } else {
      // specify normal LCT
      out.writeByte(0x80 | // 1 local color table 1=yes
        0 | // 2 interlace - 0=no
        0 | // 3 sorted - 0=no
        0 | // 4-5 reserved
        palSize); // 6-8 size of color table
    }
  }