mirror of
https://github.com/SabreTools/SabreTools.IO.git
synced 2026-07-13 04:08:23 +00:00
Fix write tests, add notes
This commit is contained in:
@@ -465,7 +465,7 @@ namespace SabreTools.IO.Test.Extensions
|
||||
[Fact]
|
||||
public void WriteTypeSequentialTest()
|
||||
{
|
||||
var stream = new MemoryStream(new byte[16], 0, 16, true, true);
|
||||
var stream = new MemoryStream(new byte[24], 0, count: 24, true, true);
|
||||
var bw = new BinaryWriter(stream);
|
||||
var obj = new TestStructSequential
|
||||
{
|
||||
|
||||
@@ -448,7 +448,7 @@ namespace SabreTools.IO.Test.Extensions
|
||||
[Fact]
|
||||
public void WriteTypeSequentialTest()
|
||||
{
|
||||
byte[] buffer = new byte[16];
|
||||
byte[] buffer = new byte[24];
|
||||
int offset = 0;
|
||||
var obj = new TestStructSequential
|
||||
{
|
||||
|
||||
@@ -412,7 +412,7 @@ namespace SabreTools.IO.Test.Extensions
|
||||
[Fact]
|
||||
public void WriteTypeSequentialTest()
|
||||
{
|
||||
var stream = new MemoryStream(new byte[16], 0, 16, true, true);
|
||||
var stream = new MemoryStream(new byte[24], 0, 24, true, true);
|
||||
var obj = new TestStructSequential
|
||||
{
|
||||
FirstValue = 0x03020100,
|
||||
|
||||
@@ -413,6 +413,7 @@ namespace SabreTools.IO.Extensions
|
||||
/// <summary>
|
||||
/// Write a <typeparamref name="T"/> to the underlying stream
|
||||
/// </summary>
|
||||
/// TODO: Fix writing as reading was fixed
|
||||
public static bool WriteType<T>(this BinaryWriter writer, T? value)
|
||||
{
|
||||
// Handle the null case
|
||||
|
||||
@@ -564,6 +564,7 @@ namespace SabreTools.IO.Extensions
|
||||
/// <summary>
|
||||
/// Write a <typeparamref name="T"/> to the byte array
|
||||
/// </summary>
|
||||
/// TODO: Fix writing as reading was fixed
|
||||
public static bool WriteType<T>(this byte[] content, ref int offset, T? value)
|
||||
{
|
||||
// Handle the null case
|
||||
|
||||
@@ -565,6 +565,7 @@ namespace SabreTools.IO.Extensions
|
||||
/// <summary>
|
||||
/// Write a <typeparamref name="T"/> to the stream
|
||||
/// </summary>
|
||||
/// TODO: Fix writing as reading was fixed
|
||||
public static bool WriteType<T>(this Stream stream, T? value)
|
||||
{
|
||||
// Handle the null case
|
||||
|
||||
Reference in New Issue
Block a user