From 5ba98b1611b5642b1cb0b0e36706434cd70aadb6 Mon Sep 17 00:00:00 2001 From: Harald Wolff-Thobaben Date: Tue, 23 Apr 2024 10:35:00 +0200 Subject: [PATCH] V1.10.0 --- build.ln | 2 +- ln.type/Extensions.cs | 22 ++++++++++++++++++++++ ln.type/ln.type.csproj | 4 ++-- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/build.ln b/build.ln index afa2528..2a0641a 100644 --- a/build.ln +++ b/build.ln @@ -3,7 +3,7 @@ "dotnet" ], "env": { - "NUGET_SOURCE": "https://nexus.niclas-thobaben.de/repository/l--n.de/", + "NUGET_SOURCE": "https://nexus.l--n.de/repository/ln.net/", "CONFIGURATION": "Release" }, "stages": [ diff --git a/ln.type/Extensions.cs b/ln.type/Extensions.cs index d2dd070..bfaf51f 100644 --- a/ln.type/Extensions.cs +++ b/ln.type/Extensions.cs @@ -209,6 +209,28 @@ namespace ln.type return BitConverter.ToDouble(bytes, 0); } + public static string ReadCString(this Stream stream) + { + byte[] buffer = new byte[1024]; + int p = 0, ch; + while ((ch = stream.ReadByte()) != -1) + { + if (ch == 0) + break; + + if (p == buffer.Length) + { + byte[] nb = new byte[buffer.Length << 1]; + Array.Copy(buffer, nb, buffer.Length); + buffer = nb; + } + + buffer[p++] = (byte)ch; + } + + return Encoding.UTF8.GetString(buffer, 0, p); + } + diff --git a/ln.type/ln.type.csproj b/ln.type/ln.type.csproj index 02715e9..79c0343 100644 --- a/ln.type/ln.type.csproj +++ b/ln.type/ln.type.csproj @@ -3,12 +3,12 @@ netcoreapp3.1 true - 0.1.7 + 0.1.9 Harald Wolff-Thobaben l--n.de 0.0.1.0 0.0.1.0 - 0.1.9-preview0 + 0.1.10-preview0