Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CA1200 code analyzer warnings #450

Merged
merged 1 commit into from
Jun 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ICSharpCode.SharpZipLib/Core/NameFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public static bool IsValidFilterExpression(string toTest)
/// Split a string into its component pieces
/// </summary>
/// <param name="original">The original string</param>
/// <returns>Returns an array of <see cref="T:System.String"/> values containing the individual filter elements.</returns>
/// <returns>Returns an array of <see cref="System.String"/> values containing the individual filter elements.</returns>
public static string[] SplitQuoted(string original)
{
char escape = '\\';
Expand Down
88 changes: 44 additions & 44 deletions src/ICSharpCode.SharpZipLib/Zip/ZipFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4003,12 +4003,12 @@ public override long Position
/// <returns>
/// The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached.
/// </returns>
/// <exception cref="T:System.ArgumentException">The sum of offset and count is larger than the buffer length. </exception>
/// <exception cref="T:System.ObjectDisposedException">Methods were called after the stream was closed. </exception>
/// <exception cref="T:System.NotSupportedException">The stream does not support reading. </exception>
/// <exception cref="T:System.ArgumentNullException">buffer is null. </exception>
/// <exception cref="T:System.IO.IOException">An I/O error occurs. </exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">offset or count is negative. </exception>
/// <exception cref="System.ArgumentException">The sum of offset and count is larger than the buffer length. </exception>
/// <exception cref="System.ObjectDisposedException">Methods were called after the stream was closed. </exception>
/// <exception cref="System.NotSupportedException">The stream does not support reading. </exception>
/// <exception cref="System.ArgumentNullException">buffer is null. </exception>
/// <exception cref="System.IO.IOException">An I/O error occurs. </exception>
/// <exception cref="System.ArgumentOutOfRangeException">offset or count is negative. </exception>
public override int Read(byte[] buffer, int offset, int count)
{
return 0;
Expand All @@ -4018,13 +4018,13 @@ public override int Read(byte[] buffer, int offset, int count)
/// Sets the position within the current stream.
/// </summary>
/// <param name="offset">A byte offset relative to the origin parameter.</param>
/// <param name="origin">A value of type <see cref="T:System.IO.SeekOrigin"></see> indicating the reference point used to obtain the new position.</param>
/// <param name="origin">A value of type <see cref="System.IO.SeekOrigin"></see> indicating the reference point used to obtain the new position.</param>
/// <returns>
/// The new position within the current stream.
/// </returns>
/// <exception cref="T:System.IO.IOException">An I/O error occurs. </exception>
/// <exception cref="T:System.NotSupportedException">The stream does not support seeking, such as if the stream is constructed from a pipe or console output. </exception>
/// <exception cref="T:System.ObjectDisposedException">Methods were called after the stream was closed. </exception>
/// <exception cref="System.IO.IOException">An I/O error occurs. </exception>
/// <exception cref="System.NotSupportedException">The stream does not support seeking, such as if the stream is constructed from a pipe or console output. </exception>
/// <exception cref="System.ObjectDisposedException">Methods were called after the stream was closed. </exception>
public override long Seek(long offset, SeekOrigin origin)
{
return 0;
Expand All @@ -4034,9 +4034,9 @@ public override long Seek(long offset, SeekOrigin origin)
/// Sets the length of the current stream.
/// </summary>
/// <param name="value">The desired length of the current stream in bytes.</param>
/// <exception cref="T:System.NotSupportedException">The stream does not support both writing and seeking, such as if the stream is constructed from a pipe or console output. </exception>
/// <exception cref="T:System.IO.IOException">An I/O error occurs. </exception>
/// <exception cref="T:System.ObjectDisposedException">Methods were called after the stream was closed. </exception>
/// <exception cref="System.NotSupportedException">The stream does not support both writing and seeking, such as if the stream is constructed from a pipe or console output. </exception>
/// <exception cref="System.IO.IOException">An I/O error occurs. </exception>
/// <exception cref="System.ObjectDisposedException">Methods were called after the stream was closed. </exception>
public override void SetLength(long value)
{
}
Expand All @@ -4047,12 +4047,12 @@ public override void SetLength(long value)
/// <param name="buffer">An array of bytes. This method copies count bytes from buffer to the current stream.</param>
/// <param name="offset">The zero-based byte offset in buffer at which to begin copying bytes to the current stream.</param>
/// <param name="count">The number of bytes to be written to the current stream.</param>
/// <exception cref="T:System.IO.IOException">An I/O error occurs. </exception>
/// <exception cref="T:System.NotSupportedException">The stream does not support writing. </exception>
/// <exception cref="T:System.ObjectDisposedException">Methods were called after the stream was closed. </exception>
/// <exception cref="T:System.ArgumentNullException">buffer is null. </exception>
/// <exception cref="T:System.ArgumentException">The sum of offset and count is greater than the buffer length. </exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">offset or count is negative. </exception>
/// <exception cref="System.IO.IOException">An I/O error occurs. </exception>
/// <exception cref="System.NotSupportedException">The stream does not support writing. </exception>
/// <exception cref="System.ObjectDisposedException">Methods were called after the stream was closed. </exception>
/// <exception cref="System.ArgumentNullException">buffer is null. </exception>
/// <exception cref="System.ArgumentException">The sum of offset and count is greater than the buffer length. </exception>
/// <exception cref="System.ArgumentOutOfRangeException">offset or count is negative. </exception>
public override void Write(byte[] buffer, int offset, int count)
{
baseStream_.Write(buffer, offset, count);
Expand Down Expand Up @@ -4132,12 +4132,12 @@ public override int ReadByte()
/// <returns>
/// The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached.
/// </returns>
/// <exception cref="T:System.ArgumentException">The sum of offset and count is larger than the buffer length. </exception>
/// <exception cref="T:System.ObjectDisposedException">Methods were called after the stream was closed. </exception>
/// <exception cref="T:System.NotSupportedException">The stream does not support reading. </exception>
/// <exception cref="T:System.ArgumentNullException">buffer is null. </exception>
/// <exception cref="T:System.IO.IOException">An I/O error occurs. </exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">offset or count is negative. </exception>
/// <exception cref="System.ArgumentException">The sum of offset and count is larger than the buffer length. </exception>
/// <exception cref="System.ObjectDisposedException">Methods were called after the stream was closed. </exception>
/// <exception cref="System.NotSupportedException">The stream does not support reading. </exception>
/// <exception cref="System.ArgumentNullException">buffer is null. </exception>
/// <exception cref="System.IO.IOException">An I/O error occurs. </exception>
/// <exception cref="System.ArgumentOutOfRangeException">offset or count is negative. </exception>
public override int Read(byte[] buffer, int offset, int count)
{
lock (baseStream_)
Expand Down Expand Up @@ -4171,12 +4171,12 @@ public override int Read(byte[] buffer, int offset, int count)
/// <param name="buffer">An array of bytes. This method copies count bytes from buffer to the current stream.</param>
/// <param name="offset">The zero-based byte offset in buffer at which to begin copying bytes to the current stream.</param>
/// <param name="count">The number of bytes to be written to the current stream.</param>
/// <exception cref="T:System.IO.IOException">An I/O error occurs. </exception>
/// <exception cref="T:System.NotSupportedException">The stream does not support writing. </exception>
/// <exception cref="T:System.ObjectDisposedException">Methods were called after the stream was closed. </exception>
/// <exception cref="T:System.ArgumentNullException">buffer is null. </exception>
/// <exception cref="T:System.ArgumentException">The sum of offset and count is greater than the buffer length. </exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">offset or count is negative. </exception>
/// <exception cref="System.IO.IOException">An I/O error occurs. </exception>
/// <exception cref="System.NotSupportedException">The stream does not support writing. </exception>
/// <exception cref="System.ObjectDisposedException">Methods were called after the stream was closed. </exception>
/// <exception cref="System.ArgumentNullException">buffer is null. </exception>
/// <exception cref="System.ArgumentException">The sum of offset and count is greater than the buffer length. </exception>
/// <exception cref="System.ArgumentOutOfRangeException">offset or count is negative. </exception>
public override void Write(byte[] buffer, int offset, int count)
{
throw new NotSupportedException();
Expand All @@ -4186,9 +4186,9 @@ public override void Write(byte[] buffer, int offset, int count)
/// When overridden in a derived class, sets the length of the current stream.
/// </summary>
/// <param name="value">The desired length of the current stream in bytes.</param>
/// <exception cref="T:System.NotSupportedException">The stream does not support both writing and seeking, such as if the stream is constructed from a pipe or console output. </exception>
/// <exception cref="T:System.IO.IOException">An I/O error occurs. </exception>
/// <exception cref="T:System.ObjectDisposedException">Methods were called after the stream was closed. </exception>
/// <exception cref="System.NotSupportedException">The stream does not support both writing and seeking, such as if the stream is constructed from a pipe or console output. </exception>
/// <exception cref="System.IO.IOException">An I/O error occurs. </exception>
/// <exception cref="System.ObjectDisposedException">Methods were called after the stream was closed. </exception>
public override void SetLength(long value)
{
throw new NotSupportedException();
Expand All @@ -4198,13 +4198,13 @@ public override void SetLength(long value)
/// When overridden in a derived class, sets the position within the current stream.
/// </summary>
/// <param name="offset">A byte offset relative to the origin parameter.</param>
/// <param name="origin">A value of type <see cref="T:System.IO.SeekOrigin"></see> indicating the reference point used to obtain the new position.</param>
/// <param name="origin">A value of type <see cref="System.IO.SeekOrigin"></see> indicating the reference point used to obtain the new position.</param>
/// <returns>
/// The new position within the current stream.
/// </returns>
/// <exception cref="T:System.IO.IOException">An I/O error occurs. </exception>
/// <exception cref="T:System.NotSupportedException">The stream does not support seeking, such as if the stream is constructed from a pipe or console output. </exception>
/// <exception cref="T:System.ObjectDisposedException">Methods were called after the stream was closed. </exception>
/// <exception cref="System.IO.IOException">An I/O error occurs. </exception>
/// <exception cref="System.NotSupportedException">The stream does not support seeking, such as if the stream is constructed from a pipe or console output. </exception>
/// <exception cref="System.ObjectDisposedException">Methods were called after the stream was closed. </exception>
public override long Seek(long offset, SeekOrigin origin)
{
long newPos = readPos_;
Expand Down Expand Up @@ -4240,7 +4240,7 @@ public override long Seek(long offset, SeekOrigin origin)
/// <summary>
/// Clears all buffers for this stream and causes any buffered data to be written to the underlying device.
/// </summary>
/// <exception cref="T:System.IO.IOException">An I/O error occurs. </exception>
/// <exception cref="System.IO.IOException">An I/O error occurs. </exception>
public override void Flush()
{
// Nothing to do.
Expand All @@ -4251,9 +4251,9 @@ public override void Flush()
/// </summary>
/// <value></value>
/// <returns>The current position within the stream.</returns>
/// <exception cref="T:System.IO.IOException">An I/O error occurs. </exception>
/// <exception cref="T:System.NotSupportedException">The stream does not support seeking. </exception>
/// <exception cref="T:System.ObjectDisposedException">Methods were called after the stream was closed. </exception>
/// <exception cref="System.IO.IOException">An I/O error occurs. </exception>
/// <exception cref="System.NotSupportedException">The stream does not support seeking. </exception>
/// <exception cref="System.ObjectDisposedException">Methods were called after the stream was closed. </exception>
public override long Position
{
get { return readPos_ - start_; }
Expand All @@ -4279,8 +4279,8 @@ public override long Position
/// </summary>
/// <value></value>
/// <returns>A long value representing the length of the stream in bytes.</returns>
/// <exception cref="T:System.NotSupportedException">A class derived from Stream does not support seeking. </exception>
/// <exception cref="T:System.ObjectDisposedException">Methods were called after the stream was closed. </exception>
/// <exception cref="System.NotSupportedException">A class derived from Stream does not support seeking. </exception>
/// <exception cref="System.ObjectDisposedException">Methods were called after the stream was closed. </exception>
public override long Length
{
get { return length_; }
Expand Down