コード例 #1
0
ファイル: VanillaIoAdapter.cs プロジェクト: danfma/db4o-net
 /// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception>
 public override void Write(byte[] buffer, int length)
 {
     _delegate.Write(buffer, length);
 }
コード例 #2
0
 public virtual void Write(long position, byte[] bytes, int bytesToWrite)
 {
     _io.Seek(position);
     _io.Write(bytes, bytesToWrite);
 }
コード例 #3
0
ファイル: IoAdapterTest.cs プロジェクト: masroore/db4o
 /// <exception cref="System.Exception"></exception>
 private void AssertReadWriteAheadFileEnd(IoAdapter adapter, string str)
 {
     var data = Runtime.GetBytesForString(str);
     var read = new byte[2048];
     adapter.Seek(10);
     var readBytes = adapter.Read(data);
     Assert.AreEqual(-1, readBytes);
     Assert.AreEqual(0, adapter.GetLength());
     adapter.Seek(0);
     readBytes = adapter.Read(data);
     Assert.AreEqual(-1, readBytes);
     Assert.AreEqual(0, adapter.GetLength());
     adapter.Seek(10);
     adapter.Write(data);
     Assert.AreEqual(10 + data.Length, adapter.GetLength());
     adapter.Seek(0);
     readBytes = adapter.Read(read);
     Assert.AreEqual(10 + data.Length, readBytes);
     adapter.Seek(20 + data.Length);
     readBytes = adapter.Read(read);
     Assert.AreEqual(-1, readBytes);
     adapter.Seek(1024 + data.Length);
     readBytes = adapter.Read(read);
     Assert.AreEqual(-1, readBytes);
     adapter.Seek(1200);
     adapter.Write(data);
     adapter.Seek(0);
     readBytes = adapter.Read(read);
     Assert.AreEqual(1200 + data.Length, readBytes);
 }
コード例 #4
0
ファイル: IoAdapterTest.cs プロジェクト: masroore/db4o
 /// <exception cref="System.Exception"></exception>
 private void AssertReadWriteString(IoAdapter adapter, string str)
 {
     var data = Runtime.GetBytesForString(str);
     var read = new byte[2048];
     adapter.Seek(0);
     adapter.Write(data);
     adapter.Seek(0);
     adapter.Read(read);
     Assert.AreEqual(str, Runtime.GetStringForBytes(read, 0, data.Length));
 }
コード例 #5
0
		private void WriteBytes(IoAdapter io, int numBytes)
		{
			io.Write(new byte[numBytes]);
		}
コード例 #6
0
ファイル: WriteCommand.cs プロジェクト: erdincay/db4o
		public virtual void Replay(IoAdapter adapter)
		{
			adapter.Write(PrepareBuffer());
		}