Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
55 lines (49 sloc) 1.53 KB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Enyim.Caching.Memcached.Results.Factories;
namespace Enyim.Caching.Memcached.Results.Helpers
{
public static class ResultHelper
{
public static string ProcessResponseData(ArraySegment<byte> data, string message = "")
{
if (data != null && data.Count > 0)
{
try
{
return message +
(! string.IsNullOrEmpty(message) ? ": " : "") +
Encoding.ASCII.GetString(data.Array, data.Offset, data.Count);
}
catch (Exception ex)
{
return ex.GetBaseException().Message;
}
}
return string.Empty;
}
}
}
#region [ License information ]
/* ************************************************************
*
* @author Couchbase <info@couchbase.com>
* @copyright 2012 Couchbase, Inc.
* @copyright 2012 Attila Kiskó, enyim.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ************************************************************/
#endregion
Something went wrong with that request. Please try again.