public static byte[] encode(String str) {final ByteBuffer bb = UTF_8.encode(str);final int len = bb.limit();if (bb.hasArray() && bb.arrayOffset() == 0) {final byte[] arr = bb.array();if (arr.length == len)return arr;}final byte[] arr = new byte[len];bb.get(arr);return arr;}

public static byte[] Encode(string str){ByteBuffer bb = NGit.Constants.CHARSET.Encode(str);int len = bb.Limit();if (bb.HasArray() && bb.ArrayOffset() == 0){byte[] arr = ((byte[])bb.Array());if (arr.Length == len){return arr;}}byte[] arr_1 = new byte[len];bb.Get(arr_1);return arr_1;}
