Skip to content

Commit

Permalink
check environment
Browse files Browse the repository at this point in the history
  • Loading branch information
j0nimost committed Oct 26, 2023
1 parent a422343 commit fd0cfc9
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/Kafa/Writer/KafaWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,23 @@ public void WriteSeparator()

public void WriteLine()
{
var newLine = new byte[2]
byte[] newLine;
if (Environment.OSVersion.Platform == PlatformID.Unix)
{
(byte)'\r',
(byte)'\n'
};
newLine = new byte[1]
{
(byte)'\n'
};
}
else
{
newLine = new byte[2]
{
(byte)'\r',
(byte)'\n'
};
}

Write(newLine);

}
Expand Down

0 comments on commit fd0cfc9

Please sign in to comment.