This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Span<T> Base64 conversion APIs that support UTF-8 (#24888)
* Add Span<T> Base64 conversion APIs that support UTF-8. * Optimize the encoding loop when there is plenty of available space * Optimize EncodeInPlace and update DecodeBaseline perf test. * Addressing PR feedback, encode optimization, throw for negative lengths * Reenable commented out perf tests. * Cap the amount of data to process based on how much that will fit. * Being explicit with access modifiers to follow guidelines.
- Loading branch information
Showing
13 changed files
with
1,813 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
namespace System.Buffers | ||
{ | ||
/// <summary> | ||
/// This enum defines the various potential status that can be returned from Span-based operations | ||
/// that support processing of input contained in multiple discontiguous buffers. | ||
/// </summary> | ||
public enum OperationStatus | ||
{ | ||
/// <summary> | ||
/// The entire input buffer has been processed and the operation is complete. | ||
/// </summary> | ||
Done, | ||
/// <summary> | ||
/// The input is partially processed, up to what could fit into the destination buffer. | ||
/// The caller can enlarge the destination buffer, slice the buffers appropriately, and retry. | ||
/// </summary> | ||
DestinationTooSmall, | ||
/// <summary> | ||
/// The input is partially processed, up to the last valid chunk of the input that could be consumed. | ||
/// The caller can stitch the remaining unprocessed input with more data, slice the buffers appropriately, and retry. | ||
/// </summary> | ||
NeedMoreData, | ||
/// <summary> | ||
/// The input contained invalid bytes which could not be processed. If the input is partially processed, | ||
/// the destination contains the partial result. This guarantees that no additional data appended to the input | ||
/// will make the invalid sequence valid. | ||
/// </summary> | ||
InvalidData, | ||
} | ||
} |
Oops, something went wrong.