示例#1
0
        private void writeSmearInfo(string text)
        {
            DataOutputStream dataOutputStream = new DataOutputStream(new FileOutputStream(text));

            dataOutputStream.writeInt(-1060454374);
            [email protected](new StringBuilder().append("writing ").append(this.unigrams.Length).toString());
            dataOutputStream.writeInt(this.unigrams.Length);
            for (int i = 0; i < this.unigrams.Length; i++)
            {
                dataOutputStream.writeFloat(this.unigramSmearTerm[i]);
            }
            for (int i = 0; i < this.unigrams.Length; i++)
            {
                [email protected](new StringBuilder().append("Writing ").append(i).append(" of ").append(this.unigrams.Length).toString());
                NGramBuffer bigramBuffer = this.getBigramBuffer(i);
                if (bigramBuffer == null)
                {
                    dataOutputStream.writeInt(0);
                }
                else
                {
                    dataOutputStream.writeInt(bigramBuffer.getNumberNGrams());
                    for (int j = 0; j < bigramBuffer.getNumberNGrams(); j++)
                    {
                        int   wordID    = bigramBuffer.getWordID(j);
                        Float smearTerm = this.getSmearTerm(i, wordID);
                        dataOutputStream.writeInt(wordID);
                        dataOutputStream.writeFloat(smearTerm.floatValue());
                    }
                }
            }
            dataOutputStream.close();
        }
示例#2
0
 public override void writePacketData(DataOutputStream dataoutputstream)
 {
     dataoutputstream.writeFloat(field_22035_a);
     dataoutputstream.writeFloat(field_22034_b);
     dataoutputstream.writeFloat(field_22037_e);
     dataoutputstream.writeFloat(field_22036_f);
     dataoutputstream.writeBoolean(field_22039_c);
     dataoutputstream.writeBoolean(field_22038_d);
 }
 public override void writePacketData(DataOutputStream dataoutputstream)
 {
     dataoutputstream.writeDouble(xPosition);
     dataoutputstream.writeDouble(yPosition);
     dataoutputstream.writeDouble(stance);
     dataoutputstream.writeDouble(zPosition);
     dataoutputstream.writeFloat(yaw);
     dataoutputstream.writeFloat(pitch);
     base.writePacketData(dataoutputstream);
 }
 protected internal virtual void writeFloat(DataOutputStream dos, float val)
 {
     if (this.swap)
     {
         dos.writeFloat(Utilities.swapFloat(val));
     }
     else
     {
         dos.writeFloat(val);
     }
 }
示例#5
0
///<summary>
///Marshal the data to the DataOutputStream.  Note: Length needs to be set before calling this method
///</summary>
        public void marshal(DataOutputStream dos)
        {
            try
            {
                dos.writeFloat((float)_powerSetting);
                dos.writeFloat((float)_engineRpm);
            } // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of marshal method
 ///<summary>
 ///Marshal the data to the DataOutputStream.  Note: Length needs to be set before calling this method
 ///</summary>
 public void marshal(DataOutputStream dos)
 {
     try
     {
         dos.writeFloat((float)_horizontalDeflectionAngle);
         dos.writeFloat((float)_verticalDeflectionAngle);
     } // end try
     catch (Exception e)
     {
         Trace.WriteLine(e);
         Trace.Flush();
     }
 } // end of marshal method
///<summary>
///Marshal the data to the DataOutputStream.  Note: Length needs to be set before calling this method
///</summary>
        public void marshal(DataOutputStream dos)
        {
            try
            {
                dos.writeFloat((float)_x);
                dos.writeFloat((float)_y);
                dos.writeFloat((float)_z);
            } // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of marshal method
 ///<summary>
 ///Marshal the data to the DataOutputStream.  Note: Length needs to be set before calling this method
 ///</summary>
 new public void marshal(DataOutputStream dos)
 {
     base.marshal(dos);
     try
     {
         _issuingEntityID.marshal(dos);
         _collidingEntityID.marshal(dos);
         _collisionEventID.marshal(dos);
         dos.writeShort((short)_pad);
         _contactVelocity.marshal(dos);
         dos.writeFloat((float)_mass);
         _location.marshal(dos);
         dos.writeFloat((float)_collisionResultXX);
         dos.writeFloat((float)_collisionResultXY);
         dos.writeFloat((float)_collisionResultXZ);
         dos.writeFloat((float)_collisionResultYY);
         dos.writeFloat((float)_collisionResultYZ);
         dos.writeFloat((float)_collisionResultZZ);
         _unitSurfaceNormal.marshal(dos);
         dos.writeFloat((float)_coefficientOfRestitution);
     } // end try
     catch (Exception e)
     {
         Trace.WriteLine(e);
         Trace.Flush();
     }
 } // end of marshal method
示例#9
0
///<summary>
///Marshal the data to the DataOutputStream.  Note: Length needs to be set before calling this method
///</summary>
        public void marshal(DataOutputStream dos)
        {
            try
            {
                dos.writeFloat((float)_beamAzimuthCenter);
                dos.writeFloat((float)_beamAzimuthSweep);
                dos.writeFloat((float)_beamElevationCenter);
                dos.writeFloat((float)_beamElevationSweep);
                dos.writeFloat((float)_beamSweepSync);
            } // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of marshal method
示例#10
0
 ///<summary>
 ///Marshal the data to the DataOutputStream.  Note: Length needs to be set before calling this method
 ///</summary>
 public void marshal(DataOutputStream dos)
 {
     try
     {
         dos.writeUshort((ushort)_activeEmissionParameterIndex);
         dos.writeUshort((ushort)_scanPattern);
         dos.writeFloat((float)_beamCenterAzimuth);
         dos.writeFloat((float)_azimuthalBeamwidth);
         dos.writeFloat((float)_beamCenterDE);
         dos.writeFloat((float)_deBeamwidth);
     } // end try
     catch (Exception e)
     {
         Trace.WriteLine(e);
         Trace.Flush();
     }
 } // end of marshal method
示例#11
0
 ///<summary>
 ///Marshal the data to the DataOutputStream.  Note: Length needs to be set before calling this method
 ///</summary>
 public void marshal(DataOutputStream dos)
 {
     try
     {
         dos.writeFloat((float)_erp);
         dos.writeFloat((float)_frequency);
         dos.writeFloat((float)_pgrf);
         dos.writeFloat((float)_pulseWidth);
         dos.writeUint((uint)_burstLength);
         dos.writeByte((byte)_applicableModes);
         dos.writeUshort((ushort)_pad2);
         dos.writeByte((byte)_pad3);
     } // end try
     catch (Exception e)
     {
         Trace.WriteLine(e);
         Trace.Flush();
     }
 } // end of marshal method
 ///<summary>
 ///Marshal the data to the DataOutputStream.  Note: Length needs to be set before calling this method
 ///</summary>
 public void marshal(DataOutputStream dos)
 {
     try
     {
         _beamDirection.marshal(dos);
         dos.writeFloat((float)_azimuthBeamwidth);
         dos.writeFloat((float)_referenceSystem);
         dos.writeShort((short)_padding1);
         dos.writeByte((byte)_padding2);
         dos.writeFloat((float)_ez);
         dos.writeFloat((float)_ex);
         dos.writeFloat((float)_phase);
     } // end try
     catch (Exception e)
     {
         Trace.WriteLine(e);
         Trace.Flush();
     }
 } // end of marshal method
示例#13
0
        private static void writeWatchableObject(DataOutputStream dataoutputstream, WatchableObject watchableobject)
        {
            int i = (watchableobject.getObjectType() << 5 | watchableobject.getDataValueId() & 0x1f) & 0xff;

            dataoutputstream.writeByte(i);
            switch (watchableobject.getObjectType())
            {
            case 0:     // '\0'
                try
                {
                    dataoutputstream.writeByte(((Byte)watchableobject.getObject()).byteValue());
                }
                catch
                {
                    dataoutputstream.writeByte((sbyte)(watchableobject.getObject()));
                }
                break;

            case 1:     // '\001'
                dataoutputstream.writeShort(((Short)watchableobject.getObject()).shortValue());
                break;

            case 2:     // '\002'
                dataoutputstream.writeInt(((Integer)watchableobject.getObject()).intValue());
                break;

            case 3:     // '\003'
                dataoutputstream.writeFloat(((Float)watchableobject.getObject()).floatValue());
                break;

            case 4:     // '\004'
                dataoutputstream.writeUTF((string)watchableobject.getObject());
                break;

            case 5:     // '\005'
                var itemstack = (ItemStack)watchableobject.getObject();
                dataoutputstream.writeShort(itemstack.getItem().shiftedIndex);
                dataoutputstream.writeByte(itemstack.stackSize);
                dataoutputstream.writeShort(itemstack.getItemDamage());
                // fall through (cant.. c# ...)
                var chunkcoordinates2 = (ChunkCoordinates)watchableobject.getObject();
                dataoutputstream.writeInt(chunkcoordinates2.posX);
                dataoutputstream.writeInt(chunkcoordinates2.posY);
                dataoutputstream.writeInt(chunkcoordinates2.posZ);

                break;

            case 6:     // '\006'
                var chunkcoordinates = (ChunkCoordinates)watchableobject.getObject();
                dataoutputstream.writeInt(chunkcoordinates.posX);
                dataoutputstream.writeInt(chunkcoordinates.posY);
                dataoutputstream.writeInt(chunkcoordinates.posZ);
                break;
            }
        }
示例#14
0
///<summary>
///Marshal the data to the DataOutputStream.  Note: Length needs to be set before calling this method
///</summary>
        new public void marshal(DataOutputStream dos)
        {
            base.marshal(dos);
            try
            {
                _radioEntityType.marshal(dos);
                dos.writeByte((byte)_transmitState);
                dos.writeByte((byte)_inputSource);
                dos.writeUshort((ushort)_padding1);
                _antennaLocation.marshal(dos);
                _relativeAntennaLocation.marshal(dos);
                dos.writeUshort((ushort)_antennaPatternType);
                dos.writeUshort((ushort)_antennaPatternList.Count);
                dos.writeUlong((ulong)_frequency);
                dos.writeFloat((float)_transmitFrequencyBandwidth);
                dos.writeFloat((float)_power);
                _modulationType.marshal(dos);
                dos.writeUshort((ushort)_cryptoSystem);
                dos.writeUshort((ushort)_cryptoKeyId);
                dos.writeByte((byte)_modulationParametersList.Count);
                dos.writeUshort((ushort)_padding2);
                dos.writeByte((byte)_padding3);

                for (int idx = 0; idx < _modulationParametersList.Count; idx++)
                {
                    Vector3Float aVector3Float = (Vector3Float)_modulationParametersList[idx];
                    aVector3Float.marshal(dos);
                } // end of list marshalling


                for (int idx = 0; idx < _antennaPatternList.Count; idx++)
                {
                    Vector3Float aVector3Float = (Vector3Float)_antennaPatternList[idx];
                    aVector3Float.marshal(dos);
                } // end of list marshalling
            }     // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of marshal method
        ///<summary>
        ///Marshal the data to the DataOutputStream.  Note: Length needs to be set before calling this method
        ///</summary>
        new public void marshal(DataOutputStream dos)
        {
            base.marshal(dos);
            try
            {
                dos.writeFloat((float)_fieldScale);
                dos.writeFloat((float)_fieldOffset);
                dos.writeUshort((ushort)_dataValues.Count);

                for (int idx = 0; idx < _dataValues.Count; idx++)
                {
                    TwoByteChunk aTwoByteChunk = (TwoByteChunk)_dataValues[idx];
                    aTwoByteChunk.marshal(dos);
                } // end of list marshalling
            }     // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of marshal method
示例#16
0
///<summary>
///Marshal the data to the DataOutputStream.  Note: Length needs to be set before calling this method
///</summary>
        public void marshal(DataOutputStream dos)
        {
            try
            {
                dos.writeFloat((float)_frequency);
                dos.writeFloat((float)_frequencyRange);
                dos.writeFloat((float)_effectiveRadiatedPower);
                dos.writeFloat((float)_pulseRepetitionFrequency);
                dos.writeFloat((float)_pulseWidth);
                dos.writeFloat((float)_beamAzimuthCenter);
                dos.writeFloat((float)_beamAzimuthSweep);
                dos.writeFloat((float)_beamElevationCenter);
                dos.writeFloat((float)_beamElevationSweep);
                dos.writeFloat((float)_beamSweepSync);
            } // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of marshal method
示例#17
0
///<summary>
///Marshal the data to the DataOutputStream.  Note: Length needs to be set before calling this method
///</summary>
        public void marshal(DataOutputStream dos)
        {
            try
            {
                dos.writeShort((short)_currentShaftRPMs);
                dos.writeShort((short)_orderedShaftRPMs);
                dos.writeFloat((float)_shaftRPMRateOfChange);
            } // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of marshal method
示例#18
0
 ///<summary>
 ///Marshal the data to the DataOutputStream.  Note: Length needs to be set before calling this method
 ///</summary>
 new public void marshal(DataOutputStream dos)
 {
     base.marshal(dos);
     try
     {
         _designatingEntityID.marshal(dos);
         dos.writeUshort((ushort)_codeName);
         _designatedEntityID.marshal(dos);
         dos.writeUshort((ushort)_designatorCode);
         dos.writeFloat((float)_designatorPower);
         dos.writeFloat((float)_designatorWavelength);
         _designatorSpotWrtDesignated.marshal(dos);
         _designatorSpotLocation.marshal(dos);
         dos.writeByte((byte)_deadReckoningAlgorithm);
         dos.writeUshort((ushort)_padding1);
         dos.writeByte((byte)_padding2);
         _entityLinearAcceleration.marshal(dos);
     } // end try
     catch (Exception e)
     {
         Trace.WriteLine(e);
         Trace.Flush();
     }
 } // end of marshal method
示例#19
0
///<summary>
///Marshal the data to the DataOutputStream.  Note: Length needs to be set before calling this method
///</summary>
        new public void marshal(DataOutputStream dos)
        {
            base.marshal(dos);
            try
            {
                dos.writeUshort((ushort)_receiverState);
                dos.writeUshort((ushort)_padding1);
                dos.writeFloat((float)_receivedPoser);
                _transmitterEntityId.marshal(dos);
                dos.writeUshort((ushort)_transmitterRadioId);
            } // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of marshal method
示例#20
0
 ///<summary>
 ///Marshal the data to the DataOutputStream.  Note: Length needs to be set before calling this method
 ///</summary>
 new public void marshal(DataOutputStream dos)
 {
     base.marshal(dos);
     try
     {
         _munitionID.marshal(dos);
         _eventID.marshal(dos);
         dos.writeUint((uint)_fireMissionIndex);
         _locationInWorldCoordinates.marshal(dos);
         _burstDescriptor.marshal(dos);
         _velocity.marshal(dos);
         dos.writeFloat((float)_range);
     } // end try
     catch (Exception e)
     {
         Trace.WriteLine(e);
         Trace.Flush();
     }
 } // end of marshal method
        public virtual void dumpBinary(string outputFile)
        {
            DataOutputStream dataOutputStream = new DataOutputStream(new FileOutputStream(outputFile));

            dataOutputStream.writeInt(this.getNumberDataPoints());
            Iterator iterator = this.allFeatures.iterator();

            while (iterator.hasNext())
            {
                float[] array  = (float[])iterator.next();
                float[] array2 = array;
                int     num    = array2.Length;
                for (int i = 0; i < num; i++)
                {
                    float num2 = array2[i];
                    dataOutputStream.writeFloat(num2);
                }
            }
            dataOutputStream.close();
        }
示例#22
0
///<summary>
///Marshal the data to the DataOutputStream.  Note: Length needs to be set before calling this method
///</summary>
        new public void marshal(DataOutputStream dos)
        {
            base.marshal(dos);
            try
            {
                _issuingEntityID.marshal(dos);
                _collidingEntityID.marshal(dos);
                _eventID.marshal(dos);
                dos.writeByte((byte)_collisionType);
                dos.writeByte((byte)_pad);
                _velocity.marshal(dos);
                dos.writeFloat((float)_mass);
                _location.marshal(dos);
            } // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of marshal method
示例#23
0
        public override void writePacketData(DataOutputStream dataoutputstream)
        {
            dataoutputstream.writeDouble(explosionX);
            dataoutputstream.writeDouble(explosionY);
            dataoutputstream.writeDouble(explosionZ);
            dataoutputstream.writeFloat(explosionSize);
            dataoutputstream.writeInt(destroyedBlockPositions.size());
            var i = (int)explosionX;
            var j = (int)explosionY;
            var k = (int)explosionZ;
            int j1;

            for (Iterator iterator = destroyedBlockPositions.iterator();
                 iterator.hasNext();
                 dataoutputstream.writeByte(j1))
            {
                var chunkposition = (ChunkPosition)iterator.next();
                int l             = chunkposition.x - i;
                int i1            = chunkposition.y - j;
                j1 = chunkposition.z - k;
                dataoutputstream.writeByte(l);
                dataoutputstream.writeByte(i1);
            }
        }
///<summary>
///Marshal the data to the DataOutputStream.  Note: Length needs to be set before calling this method
///</summary>
        new public void marshal(DataOutputStream dos)
        {
            base.marshal(dos);
            try
            {
                dos.writeUshort((ushort)_site);
                dos.writeUshort((ushort)_application);
                dos.writeUshort((ushort)_entity);
                dos.writeByte((byte)_forceId);
                dos.writeByte((byte)_articulationParameters.Count);
                dos.writeByte((byte)_entityKind);
                dos.writeByte((byte)_domain);
                dos.writeUshort((ushort)_country);
                dos.writeByte((byte)_category);
                dos.writeByte((byte)_subcategory);
                dos.writeByte((byte)_specific);
                dos.writeByte((byte)_extra);
                dos.writeByte((byte)_altEntityKind);
                dos.writeByte((byte)_altDomain);
                dos.writeUshort((ushort)_altCountry);
                dos.writeByte((byte)_altCategory);
                dos.writeByte((byte)_altSubcategory);
                dos.writeByte((byte)_altSpecific);
                dos.writeByte((byte)_altExtra);
                dos.writeFloat((float)_xVelocity);
                dos.writeFloat((float)_yVelocity);
                dos.writeFloat((float)_zVelocity);
                dos.writeDouble((double)_xLocation);
                dos.writeDouble((double)_yLocation);
                dos.writeDouble((double)_zLocation);
                dos.writeFloat((float)_psi);
                dos.writeFloat((float)_theta);
                dos.writeFloat((float)_phi);
                dos.writeUint((uint)_entityAppearance);
                dos.writeByte((byte)_deadReckoningAlgorithm);

                for (int idx = 0; idx < _otherParameters.Length; idx++)
                {
                    dos.writeByte(_otherParameters[idx]);
                } // end of array marshaling

                dos.writeFloat((float)_xAcceleration);
                dos.writeFloat((float)_yAcceleration);
                dos.writeFloat((float)_zAcceleration);
                dos.writeFloat((float)_xAngularVelocity);
                dos.writeFloat((float)_yAngularVelocity);
                dos.writeFloat((float)_zAngularVelocity);

                for (int idx = 0; idx < _marking.Length; idx++)
                {
                    dos.writeByte(_marking[idx]);
                } // end of array marshaling

                dos.writeUint((uint)_capabilities);

                for (int idx = 0; idx < _articulationParameters.Count; idx++)
                {
                    ArticulationParameter aArticulationParameter = (ArticulationParameter)_articulationParameters[idx];
                    aArticulationParameter.marshal(dos);
                } // end of list marshalling
            }     // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of marshal method
示例#25
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public org.neo4j.storageengine.api.WritableChannel putFloat(float value) throws java.io.IOException
        public override WritableChannel PutFloat(float value)
        {
            _dataOutputStream.writeFloat(value);
            return(this);
        }
示例#26
0
 public override void writePacketData(DataOutputStream dataoutputstream)
 {
     dataoutputstream.writeFloat(yaw);
     dataoutputstream.writeFloat(pitch);
     base.writePacketData(dataoutputstream);
 }