internal void ApplyTo(IFileSystemInterface fsi) { fsi.SetWritePosition(_position, false); foreach (var bytes in _listOfBytes) fsi.WriteBytes(bytes, false); }
internal void PersistMeTo(IFileSystemInterface fsi) { var sizeOfLong = OdbType.Long.Size; var sizeOfInt = OdbType.Integer.Size; // build the full byte array to write once var bytes = new byte[sizeOfLong + sizeOfInt + _size]; var bytesOfPosition = ByteArrayConverter.LongToByteArray(_position); var bytesOfSize = ByteArrayConverter.IntToByteArray(_size); for (var i = 0; i < sizeOfLong; i++) { bytes[i] = bytesOfPosition[i]; } var offset = sizeOfLong; for (var i = 0; i < sizeOfInt; i++) { bytes[offset] = bytesOfSize[i]; offset++; } foreach (var tmp in _listOfBytes) { Buffer.BlockCopy(tmp, 0, bytes, offset, tmp.Length); offset += tmp.Length; } fsi.WriteBytes(bytes, false); }
internal void PersistMeTo(IFileSystemInterface fsi) { var sizeOfLong = OdbType.Long.Size; var sizeOfInt = OdbType.Integer.Size; // build the full byte array to write once var bytes = new byte[sizeOfLong + sizeOfInt + _size]; var bytesOfPosition = ByteArrayConverter.LongToByteArray(_position); var bytesOfSize = ByteArrayConverter.IntToByteArray(_size); for (var i = 0; i < sizeOfLong; i++) bytes[i] = bytesOfPosition[i]; var offset = sizeOfLong; for (var i = 0; i < sizeOfInt; i++) { bytes[offset] = bytesOfSize[i]; offset++; } foreach (var tmp in _listOfBytes) { Buffer.BlockCopy(tmp, 0, bytes, offset, tmp.Length); offset += tmp.Length; } fsi.WriteBytes(bytes, false); }
internal void ApplyTo(IFileSystemInterface fsi) { fsi.SetWritePosition(_position, false); foreach (var bytes in _listOfBytes) { fsi.WriteBytes(bytes, false); } }