public static void Write( DataOutput output, IntSeqKeyTwo key) { output.WriteInt(key.One); output.WriteInt(key.Last); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: void writeExternal(java.io.DataOutput out) throws java.io.IOException internal void WriteExternal(DataOutput @out) { @out.WriteUTF(Chrono.Id); @out.WriteInt(Years); @out.WriteInt(Months); @out.WriteInt(Days); }
/// <summary> /// Writes the state to the stream. /// </summary> /// <param name="out"> the output stream, not null </param> /// <exception cref="IOException"> if an error occurs </exception> //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: void writeExternal(java.io.DataOutput out) throws java.io.IOException internal void WriteExternal(DataOutput @out) { @out.WriteInt(StandardTransitions.Length); foreach (long trans in StandardTransitions) { Ser.WriteEpochSec(trans, @out); } foreach (ZoneOffset offset in StandardOffsets) { Ser.WriteOffset(offset, @out); } @out.WriteInt(SavingsInstantTransitions.Length); foreach (long trans in SavingsInstantTransitions) { Ser.WriteEpochSec(trans, @out); } foreach (ZoneOffset offset in WallOffsets) { Ser.WriteOffset(offset, @out); } @out.WriteByte(LastRules.Length); foreach (ZoneOffsetTransitionRule rule in LastRules) { rule.WriteExternal(@out); } }
/// <summary> /// Serialize a /// <see cref="INodeReference"/> /// node /// </summary> /// <exception cref="System.IO.IOException"/> private static void WriteINodeReference(INodeReference @ref, DataOutput @out, bool writeUnderConstruction, SnapshotFSImageFormat.ReferenceMap referenceMap) { WriteLocalName(@ref, @out); @out.WriteLong(@ref.GetId()); @out.WriteShort(0); // replication @out.WriteLong(0); // modification time @out.WriteLong(0); // access time @out.WriteLong(0); // preferred block size @out.WriteInt(-3); // # of blocks bool isWithName = @ref is INodeReference.WithName; @out.WriteBoolean(isWithName); if (!isWithName) { Preconditions.CheckState(@ref is INodeReference.DstReference); // dst snapshot id @out.WriteInt(((INodeReference.DstReference)@ref).GetDstSnapshotId()); } else { @out.WriteInt(((INodeReference.WithName)@ref).GetLastSnapshotId()); } INodeReference.WithCount withCount = (INodeReference.WithCount)@ref.GetReferredINode (); referenceMap.WriteINodeReferenceWithCount(withCount, @out, writeUnderConstruction ); }
public static void Write( DataOutput output, IntSeqKeyThree key) { output.WriteInt(key.One); output.WriteInt(key.Two); output.WriteInt(key.Three); }
public static void WriteArray( int[] ints, DataOutput output) { output.WriteInt(ints.Length); foreach (var value in ints) { output.WriteInt(value); } }
public static void Write( DataOutput output, IntSeqKeyMany key) { var array = key.Array; output.WriteInt(array.Length); foreach (var i in array) { output.WriteInt(i); } }
/// <summary> /// NOTE: Code-generation-invoked method, method name and parameter order matters /// </summary> /// <param name="output">output</param> /// <param name="valueSet">values</param> /// <throws>IOException io error</throws> public static void WritePoints( DataOutput output, RefCountedSet<double> valueSet) { var refSet = valueSet.RefSet; output.WriteInt(refSet.Count); output.WriteInt(valueSet.NumValues); foreach (var entry in valueSet.RefSet) { output.WriteDouble(entry.Key); output.WriteInt(entry.Value); } }
/// <summary> /// Writes a codec header, which records both a string to /// identify the file and a version number. this header can /// be parsed and validated with /// <seealso cref="#checkHeader(DataInput, String, int, int) checkHeader()"/>. /// <p> /// CodecHeader --> Magic,CodecName,Version /// <ul> /// <li>Magic --> <seealso cref="DataOutput#writeInt Uint32"/>. this /// identifies the start of the header. It is always {@value #CODEC_MAGIC}. /// <li>CodecName --> <seealso cref="DataOutput#writeString String"/>. this /// is a string to identify this file. /// <li>Version --> <seealso cref="DataOutput#writeInt Uint32"/>. Records /// the version of the file. /// </ul> /// <p> /// Note that the length of a codec header depends only upon the /// name of the codec, so this length can be computed at any time /// with <seealso cref="#headerLength(String)"/>. /// </summary> /// <param name="out"> Output stream </param> /// <param name="codec"> String to identify this file. It should be simple ASCII, /// less than 128 characters in length. </param> /// <param name="version"> Version number </param> /// <exception cref="IOException"> If there is an I/O error writing to the underlying medium. </exception> public static void WriteHeader(DataOutput @out, string codec, int version) { BytesRef bytes = new BytesRef(codec); if (bytes.Length != codec.Length || bytes.Length >= 128) { throw new System.ArgumentException("codec must be simple ASCII, less than 128 characters in length [got " + codec + "]"); } @out.WriteInt(CODEC_MAGIC); @out.WriteString(codec); @out.WriteInt(version); }
private void WriteInternal(BigInteger[] @object, DataOutput output) { if (@object == null) { output.WriteInt(-1); return; } output.WriteInt(@object.Length); foreach (BigInteger i in @object) { DIOBigIntegerSerde.INSTANCE.Write(i, output); } }
private void WriteArray(decimal[] array, DataOutput output) { if (array == null) { output.WriteInt(-1); return; } output.WriteInt(array.Length); foreach (decimal i in array) { output.WriteDecimal(i); } }
private void WriteInternal(float[] @object, DataOutput output) { if (@object == null) { output.WriteInt(-1); return; } output.WriteInt(@object.Length); foreach (float i in @object) { output.WriteFloat(i); } }
private void WriteArray(bool[] array, DataOutput output) { if (array == null) { output.WriteInt(-1); return; } output.WriteInt(array.Length); foreach (bool i in array) { output.WriteBoolean(i); } }
private void WriteArray(int[] array, DataOutput output) { if (array == null) { output.WriteInt(-1); return; } output.WriteInt(array.Length); foreach (int i in array) { output.WriteInt(i); } }
private void WriteInternal(double?[][] @object, DataOutput output) { if (@object == null) { output.WriteInt(-1); return; } output.WriteInt(@object.Length); foreach (double?[] i in @object) { DIOBoxedDoubleArrayNullableSerde.INSTANCE.Write(i, output); } }
private void WriteInternal(bool[] @object, DataOutput output) { if (@object == null) { output.WriteInt(-1); return; } output.WriteInt(@object.Length); foreach (bool i in @object) { output.WriteBoolean(i); } }
private void WriteInternal(double[] @object, DataOutput output) { if (@object == null) { output.WriteInt(-1); return; } output.WriteInt(@object.Length); foreach (double i in @object) { output.WriteDouble(i); } }
private void WriteInternal(long?[] @object, DataOutput output) { if (@object == null) { output.WriteInt(-1); return; } output.WriteInt(@object.Length); foreach (long?i in @object) { DIONullableLongSerde.INSTANCE.Write(i, output); } }
private void WriteInternal(string[] @object, DataOutput output) { if (@object == null) { output.WriteInt(-1); return; } output.WriteInt(@object.Length); foreach (string i in @object) { DIOStringSerde.INSTANCE.Write(i, output); } }
private void WriteInternal(long[] @object, DataOutput output) { if (@object == null) { output.WriteInt(-1); return; } output.WriteInt(@object.Length); foreach (long i in @object) { output.WriteLong(i); } }
private void WriteInternal( byte[] @object, DataOutput output) { if (@object == null) { output.WriteInt(-1); return; } output.WriteInt(@object.Length); output.Write(@object); }
public override void Write(bool[][] @object, DataOutput output, byte[] unitKey, EventBeanCollatedWriter writer) { if (@object == null) { output.WriteInt(-1); return; } output.WriteInt(@object.Length); foreach (bool[] i in @object) { WriteArray(i, output); } }
/// <summary> /// Serializes the data set to file using the following format: /// <ul> /// <li>FuzzySet -->FuzzySetVersion,HashFunctionName,BloomSize, /// NumBitSetWords,BitSetWord<sup>NumBitSetWords</sup></li> /// <li>HashFunctionName --> {@link DataOutput#writeString(String) String} The /// name of a ServiceProvider registered {@link HashFunction}</li> /// <li>FuzzySetVersion --> {@link DataOutput#writeInt Uint32} The version number of the {@link FuzzySet} class</li> /// <li>BloomSize --> {@link DataOutput#writeInt Uint32} The modulo value used /// to project hashes into the field's Bitset</li> /// <li>NumBitSetWords --> {@link DataOutput#writeInt Uint32} The number of /// longs (as returned from {@link FixedBitSet#getBits})</li> /// <li>BitSetWord --> {@link DataOutput#writeLong Long} A long from the array /// returned by {@link FixedBitSet#getBits}</li> /// </ul> /// @param out Data output stream /// @ If there is a low-level I/O error /// </summary> public void Serialize(DataOutput output) { output.WriteInt(VERSION_CURRENT); output.WriteInt(_bloomSize); var bits = _filter.Bits; output.WriteInt(bits.Length); foreach (var t in bits) { // Can't used VLong encoding because cant cope with negative numbers // output by FixedBitSet output.WriteLong(t); } }
/// <summary> /// Write /// <see cref="snapshotCounter"/> /// , /// <see cref="numSnapshots"/> /// , /// and all snapshots to the DataOutput. /// </summary> /// <exception cref="System.IO.IOException"/> public virtual void Write(DataOutput @out) { @out.WriteInt(snapshotCounter); @out.WriteInt(numSnapshots.Get()); // write all snapshots. foreach (INodeDirectory snapshottableDir in snapshottables.Values) { foreach (Org.Apache.Hadoop.Hdfs.Server.Namenode.Snapshot.Snapshot s in snapshottableDir .GetDirectorySnapshottableFeature().GetSnapshotList()) { s.Write(@out); } } }
private void WriteInternal( char[] @object, DataOutput output) { if (@object == null) { output.WriteInt(-1); return; } output.WriteInt(@object.Length); foreach (var i in @object) { output.WriteChar(i); } }
/// <summary> /// Writes the state to the stream. /// </summary> /// <param name="out"> the output stream, not null </param> /// <exception cref="IOException"> if an error occurs </exception> //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: void writeExternal(java.io.DataOutput out) throws java.io.IOException internal void WriteExternal(DataOutput @out) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final int timeSecs = (timeEndOfDay ? 86400 : time.toSecondOfDay()); int timeSecs = (TimeEndOfDay ? 86400 : Time.ToSecondOfDay()); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final int stdOffset = standardOffset.getTotalSeconds(); int stdOffset = StandardOffset_Renamed.TotalSeconds; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final int beforeDiff = offsetBefore.getTotalSeconds() - stdOffset; int beforeDiff = OffsetBefore_Renamed.TotalSeconds - stdOffset; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final int afterDiff = offsetAfter.getTotalSeconds() - stdOffset; int afterDiff = OffsetAfter_Renamed.TotalSeconds - stdOffset; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final int timeByte = (timeSecs % 3600 == 0 ? (timeEndOfDay ? 24 : time.getHour()) : 31); int timeByte = (timeSecs % 3600 == 0 ? (TimeEndOfDay ? 24 : Time.Hour) : 31); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final int stdOffsetByte = (stdOffset % 900 == 0 ? stdOffset / 900 + 128 : 255); int stdOffsetByte = (stdOffset % 900 == 0 ? stdOffset / 900 + 128 : 255); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final int beforeByte = (beforeDiff == 0 || beforeDiff == 1800 || beforeDiff == 3600 ? beforeDiff / 1800 : 3); int beforeByte = (beforeDiff == 0 || beforeDiff == 1800 || beforeDiff == 3600 ? beforeDiff / 1800 : 3); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final int afterByte = (afterDiff == 0 || afterDiff == 1800 || afterDiff == 3600 ? afterDiff / 1800 : 3); int afterByte = (afterDiff == 0 || afterDiff == 1800 || afterDiff == 3600 ? afterDiff / 1800 : 3); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final int dowByte = (dow == null ? 0 : dow.getValue()); int dowByte = (Dow == null ? 0 : Dow.Value); int b = (Month_Renamed.Value << 28) + ((Dom + 32) << 22) + (dowByte << 19) + (timeByte << 14) + (TimeDefinition_Renamed.ordinal() << 12) + (stdOffsetByte << 4) + (beforeByte << 2) + afterByte; // 2 bits - 2 bits - 8 bits - 2 bits - 5 bits - 3 bits - 6 bits - 4 bits @out.WriteInt(b); if (timeByte == 31) { @out.WriteInt(timeSecs); } if (stdOffsetByte == 255) { @out.WriteInt(stdOffset); } if (beforeByte == 3) { @out.WriteInt(OffsetBefore_Renamed.TotalSeconds); } if (afterByte == 3) { @out.WriteInt(OffsetAfter_Renamed.TotalSeconds); } }
/// <exception cref="System.IO.IOException"/> private static void WriteBlocks(Block[] blocks, DataOutput @out) { if (blocks == null) { @out.WriteInt(0); } else { @out.WriteInt(blocks.Length); foreach (Block blk in blocks) { blk.Write(@out); } } }
public override void Write( RefCountedSet <object> valueSet, DataOutput output, byte[] unitKey, EventBeanCollatedWriter writer) { output.WriteInt(valueSet.RefSet.Count); foreach (var entry in valueSet.RefSet) { _inner.Write(entry.Key, output, unitKey, writer); output.WriteInt(entry.Value); } output.WriteInt(valueSet.NumValues); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: void writeExternal(java.io.DataOutput out) throws java.io.IOException internal void WriteExternal(DataOutput @out) { // MinguoChronology is implicit in the MINGUO_DATE_TYPE @out.WriteInt(get(YEAR)); @out.WriteByte(get(MONTH_OF_YEAR)); @out.WriteByte(get(DAY_OF_MONTH)); }
private void WriteInternal( DateTimeEx[] @object, DataOutput output) { if (@object == null) { output.WriteInt(-1); return; } output.WriteInt(@object.Length); foreach (DateTimeEx value in @object) { DIODateTimeExSerde.INSTANCE.Write(value, output); } }
/// <summary> /// Serializes the data set to file using the following format: /// <ul> /// <li>FuzzySet -->FuzzySetVersion,HashFunctionName,BloomSize, /// NumBitSetWords,BitSetWord<sup>NumBitSetWords</sup></li> /// <li>HashFunctionName --> {@link DataOutput#writeString(String) String} The /// name of a ServiceProvider registered {@link HashFunction}</li> /// <li>FuzzySetVersion --> {@link DataOutput#writeInt Uint32} The version number of the {@link FuzzySet} class</li> /// <li>BloomSize --> {@link DataOutput#writeInt Uint32} The modulo value used /// to project hashes into the field's Bitset</li> /// <li>NumBitSetWords --> {@link DataOutput#writeInt Uint32} The number of /// longs (as returned from {@link FixedBitSet#getBits})</li> /// <li>BitSetWord --> {@link DataOutput#writeLong Long} A long from the array /// returned by {@link FixedBitSet#getBits}</li> /// </ul> /// @param out Data output stream /// @ If there is a low-level I/O error /// </summary> public void Serialize(DataOutput output) { output.WriteInt(VERSION_CURRENT); output.WriteInt(_bloomSize); var bits = _filter.Bits; output.WriteInt(bits.Length); foreach (var t in bits) { // Can't used VLong encoding because cant cope with negative numbers // output by FixedBitSet output.WriteLong(t); } }