Sharpen.RandomAccessFile.Write C# (CSharp) Method

Write() public method

public Write ( byte buffer ) : void
buffer byte
return void
        public void Write(byte[] buffer)
        {
            stream.Write (buffer, 0, buffer.Length);
        }

Same methods

RandomAccessFile::Write ( byte buffer, int start, int size ) : void

Usage Example

		/// <exception cref="System.IO.IOException"></exception>
		public override PackLock Parse(ProgressMonitor receiving, ProgressMonitor resolving
			)
		{
			tmpPack = FilePath.CreateTempFile("incoming_", ".pack", db.GetDirectory());
			tmpIdx = new FilePath(db.GetDirectory(), BaseName(tmpPack) + ".idx");
			try
			{
				@out = new RandomAccessFile(tmpPack, "rw");
				base.Parse(receiving, resolving);
				@out.Seek(packEnd);
				@out.Write(packHash);
				@out.GetChannel().Force(true);
				@out.Close();
				WriteIdx();
				tmpPack.SetReadOnly();
				tmpIdx.SetReadOnly();
				return RenameAndOpenPack(GetLockMessage());
			}
			finally
			{
				if (def != null)
				{
					def.Finish();
				}
				try
				{
					if (@out != null && @out.GetChannel().IsOpen())
					{
						@out.Close();
					}
				}
				catch (IOException)
				{
				}
				// Ignored. We want to delete the file.
				CleanupTemporaryFiles();
			}
		}