/* */ public static sbyte[] Int2ByteArray(int num) { using (var stream = new MemoryStream()) using (var writer = new BinaryWriter(stream)) { writer.Write(num); return(ByteHelper.FromByteArray(stream.GetBuffer())); } // /* 7 */ // java.io.ByteArrayOutputStream bos = new java.io.ByteArrayOutputStream(); ///* */ ///* 9 */ //sbyte[] buffer = null; ///* */ //try //{ // /* 11 */ // DataOutputStream oos = new DataOutputStream(bos); // /* 12 */ // oos.writeInt(num); // /* 13 */ // oos.flush(); // /* 14 */ // oos.close(); // /* 15 */ // buffer = bos.toByteArray(); // /* 16 */ // bos.close(); // /* */ //} //catch (Exception e) //{ // /* 18 */ // Console.WriteLine(e.ToString()); // Console.Write(e.StackTrace); // /* */ //} /* */ ///* 21 */ //return buffer; /* */ } /* */