public int write(DataOutputStream dos) { int size = 5; dos.WriteUTF(Streamable.MESSAGE_IONO); // 5 dos.WriteInt(STREAM_V); size += 4; dos.WriteLong(health); size += 8; dos.WriteDouble(utcA1); size += 8; dos.WriteDouble(utcA0); size += 8; dos.WriteLong(utcTOW); size += 8; dos.WriteInt(utcWNT); size += 4; dos.WriteInt(utcLS); size += 4; dos.WriteInt(utcWNF); size += 4; dos.WriteInt(utcDN); size += 4; dos.WriteInt(utcLSF); size += 4; for (int i = 0; i < alpha.Count(); i++) { dos.WriteFloat(alpha[i]); size += 4; } for (int i = 0; i < beta.Count(); i++) { dos.WriteFloat(beta[i]); size += 4; } dos.WriteBoolean(validHealth); size += 1; dos.WriteBoolean(validUTC); size += 1; dos.WriteBoolean(validKlobuchar); size += 1; dos.WriteLong(refTime == null ? -1 : refTime.getMsec()); size += 8; return(size); }
public override void ToOutputStream(DataOutputStream writer) { //Server to Client writer.WriteBoolean(DeckImage != null); if (DeckImage != null) { writer.WriteInt(ImageSlot); //Byte array lenght writer.WriteInt(DeckImage.InternalBitmap.Length); writer.Write(DeckImage.InternalBitmap); Json headerContent = new Json(); headerContent.Font = " "; headerContent.Size = CurrentItem.Decksize; headerContent.Position = CurrentItem.Deckposition; headerContent.Text = CurrentItem.Deckname; headerContent.Color = CurrentItem.Deckcolor; headerContent.Stroke_color = CurrentItem.Stroke_color; headerContent.Stroke_dx = CurrentItem.Stroke_dxtext; headerContent.Stroke_radius = CurrentItem.Stroke_radius; headerContent.Stroke_dy = CurrentItem.Stroke_Dy; headerContent.IsStroke = CurrentItem.IsStroke; headerContent.Isboldtext = CurrentItem.Isboldtext; headerContent.Isnormaltext = CurrentItem.Isnormaltext; headerContent.Isitalictext = CurrentItem.Isitalictext; headerContent.Ishinttext = CurrentItem.Ishinttext; string jsonString = JsonConvert.SerializeObject(headerContent, Formatting.None); writer.WriteUTF(jsonString); } }
private static void WriteJavaField(this DataOutputStream stream, MetadataJavaField field) { stream.WriteUTF(field.Name); stream.WriteUTF(field.Type); stream.WriteAccessFlagsParameter(field.AccessFlags); stream.WriteBoolean(field.ConstantValue != null); if (field.ConstantValue != null) { stream.WriteArray(field.ConstantValue, b => stream.WriteByte(b)); } }
public override void ToOutputStream(DataOutputStream writer) { //From server to client //Tell the client if they are going to receive a device Guid writer.WriteBoolean(!hasDeviceGuid); if (!hasDeviceGuid) { DeviceGuid = Guid.NewGuid(); writer.WriteUTF(DeviceGuid.ToString()); } }
public override void ToOutputStream(DataOutputStream writer) { //Server to Client writer.WriteBoolean(DeckImage != null); if (DeckImage != null) { writer.WriteInt(ImageSlot); //Byte array lenght writer.WriteInt(DeckImage.InternalBitmap.Length); writer.Write(DeckImage.InternalBitmap); } }
public static void WriteUploadTagsResult(this DataOutputStream output, TagConfirmation[] value) { if (value == null) { throw new ArgumentNullException("value"); } output.WriteInt32(value.Length); foreach (var item in value) { output.WriteString(item.DeviceID); output.WriteBoolean(item.ConfirmedByServer); } }
/// <summary> /// Write out a header to the given stream that indicates the chosen /// compression codec, and return the same stream wrapped with that codec. /// </summary> /// <remarks> /// Write out a header to the given stream that indicates the chosen /// compression codec, and return the same stream wrapped with that codec. /// If no codec is specified, simply adds buffering to the stream, so that /// the returned stream is always buffered. /// </remarks> /// <param name="os"> /// The stream to write header to and wrap. This stream should /// be unbuffered. /// </param> /// <returns> /// A stream wrapped with the specified compressor, or buffering /// if compression is not enabled. /// </returns> /// <exception cref="System.IO.IOException"> /// if an IO error occurs or the compressor cannot be /// instantiated /// </exception> internal virtual DataOutputStream WriteHeaderAndWrapStream(OutputStream os) { DataOutputStream dos = new DataOutputStream(os); dos.WriteBoolean(imageCodec != null); if (imageCodec != null) { string codecClassName = imageCodec.GetType().GetCanonicalName(); Text.WriteString(dos, codecClassName); return(new DataOutputStream(imageCodec.CreateOutputStream(os))); } else { // use a buffered output stream return(new DataOutputStream(new BufferedOutputStream(os))); } }
protected internal virtual void Save(DataOutputStream file, IDictionary <string, ICollection <string> > tagTokens) { try { file.WriteInt(index.Size()); foreach (string item in index) { file.WriteUTF(item); if (learnClosedTags) { if (tagTokens[item].Count < closedTagThreshold) { MarkClosed(item); } } file.WriteBoolean(IsClosed(item)); } } catch (IOException e) { throw new RuntimeIOException(e); } }
public void Return(DataOutputStream output) { output.WriteBoolean(_result); }
public void FileWriteBool(bool val) { OutputStream.WriteBoolean(val); }