mirror of
https://github.com/mm201/pkmn-classic-framework.git
synced 2026-03-22 01:44:20 -05:00
26 lines
725 B
C#
26 lines
725 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.IO;
|
|
|
|
namespace PkmnFoundations.Support
|
|
{
|
|
public static class StringHelper
|
|
{
|
|
public static String BytesToString(byte[] data, Encoding encoding)
|
|
{
|
|
MemoryStream ms = new MemoryStream(data);
|
|
StreamReader sr = new StreamReader(ms, encoding);
|
|
return sr.ReadToEnd();
|
|
}
|
|
|
|
public static String BytesToString(byte[] data, int start, int length, Encoding encoding)
|
|
{
|
|
MemoryStream ms = new MemoryStream(data, start, length);
|
|
StreamReader sr = new StreamReader(ms, encoding);
|
|
return sr.ReadToEnd();
|
|
}
|
|
}
|
|
}
|