mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-28 01:08:04 +00:00
fixed C# bytebuffer put methods
This commit is contained in:
@@ -35,13 +35,18 @@ namespace FlatBuffers
|
||||
|
||||
public byte[] Data { get { return _buffer; } }
|
||||
|
||||
public ByteBuffer(byte[] buffer)
|
||||
public ByteBuffer(byte[] buffer) : this(buffer, 0) { }
|
||||
|
||||
public ByteBuffer(byte[] buffer, int pos)
|
||||
{
|
||||
_buffer = buffer;
|
||||
_pos = 0;
|
||||
_pos = pos;
|
||||
}
|
||||
|
||||
public int Position { get { return _pos; } }
|
||||
public int Position {
|
||||
get { return _pos; }
|
||||
set { _pos = value; }
|
||||
}
|
||||
|
||||
// Pre-allocated helper arrays for convertion.
|
||||
private float[] floathelper = new[] { 0.0f };
|
||||
@@ -92,7 +97,6 @@ namespace FlatBuffers
|
||||
_buffer[offset + count - 1 - i] = (byte)(data >> i * 8);
|
||||
}
|
||||
}
|
||||
_pos = offset;
|
||||
}
|
||||
|
||||
protected ulong ReadLittleEndian(int offset, int count)
|
||||
@@ -129,14 +133,12 @@ namespace FlatBuffers
|
||||
{
|
||||
AssertOffsetAndLength(offset, sizeof(sbyte));
|
||||
_buffer[offset] = (byte)value;
|
||||
_pos = offset;
|
||||
}
|
||||
|
||||
public void PutByte(int offset, byte value)
|
||||
{
|
||||
AssertOffsetAndLength(offset, sizeof(byte));
|
||||
_buffer[offset] = value;
|
||||
_pos = offset;
|
||||
}
|
||||
|
||||
// this method exists in order to conform with Java ByteBuffer standards
|
||||
|
||||
Reference in New Issue
Block a user