public static CharBuffer Wrap(string str) { CharBuffer buffer = new CharBuffer (); buffer.Wrapped = str; return buffer; }
/// <exception cref="Mp3net.Helpers.CharacterCodingException"></exception> internal static byte[] CharBufferToBytes(CharBuffer charBuffer, string characterSet) { Encoding charset = Mp3net.Helpers.Extensions.GetEncoding(characterSet); CharsetEncoder encoder = charset.NewEncoder(); ByteBuffer byteBuffer = encoder.Encode(charBuffer); return BufferTools.CopyBuffer(((byte[])byteBuffer.Array()), 0, byteBuffer.Limit() ); }