Sharpen.FilePath.Length C# (CSharp) Method

Length() public method

public Length ( ) : long
return long
		public long Length ()
		{
			return FileHelper.Instance.Length (this);
		}

Usage Example

Esempio n. 1
0
		public static sbyte[] ReadBytes(FilePath file)
		{
			int length = (int)file.Length();
			// should only be zero if loading from a network or similar
			System.Diagnostics.Debug.Assert((length != 0));
			sbyte[] bytes = new sbyte[length];
			int totalBytesRead = 0;
			FileInputStream inputStream = null;
			try
			{
				inputStream = new FileInputStream(file);
				while (totalBytesRead != length)
				{
					int bytesRead = inputStream.Read(bytes, totalBytesRead, length - totalBytesRead);
					if (bytesRead == -1)
					{
						break;
					}
					totalBytesRead += bytesRead;
				}
			}
			finally
			{
				if (inputStream != null)
				{
					inputStream.Close();
				}
			}
			return bytes;
		}
All Usage Examples Of Sharpen.FilePath::Length