2012年5月3日

将byte[]通过BinaryReader转换成对象

摘要: public static object ConvertResponseToObject(byte[] Bytes){if (Bytes == null || Bytes.Length == 0) { return null; }byte[] tempBytes = Bytes.Clone() as byte[];using (MemoryStream memoryStream = new MemoryStream(tempBytes)){BinaryReader binaryReader = new BinaryReader(memoryStream);audio_search_resp r 阅读全文

posted @ 2012-05-03 10:29 哥是技术人 阅读(615) 评论(0) 推荐(0)

将对象通过BinaryWriter转换成byte[]

摘要: public static byte[] ConvertRequestToBytes(audio_search_req requestData){using (MemoryStream memoryStream = new MemoryStream()){BinaryWriter binaryWriter = new BinaryWriter(memoryStream);binaryWriter.Write(requestData.version);binaryWriter.Write(requestData.queryFname);binaryWriter.Write(requestData 阅读全文

posted @ 2012-05-03 10:29 哥是技术人 阅读(938) 评论(0) 推荐(0)

JNA调用C++的DLL

摘要: import com.sun.jna.*;import com.sun.jna.platform.*;import com.sun.jna.platform.win32.WinNT;import com.sun.jna.win32.*;import java.util.ArrayList;public class TestJNA {public interface MyDrivers extends StdCallLibrary {MyDrivers INSTANCE1 = (MyDrivers)Native.loadLibrary("D:\\NCR_JNI\\DLL\\CRT_35 阅读全文

posted @ 2012-05-03 10:28 哥是技术人 阅读(332) 评论(0) 推荐(0)

Linux命令行在su root后突然变成bash-4.1$的办法

摘要: 1 在根目录下建立root目录2 拷贝/etc/skel目录下的.bash_logout和.bashrc和.bash_profile到root目录即可。 阅读全文

posted @ 2012-05-03 10:28 哥是技术人 阅读(646) 评论(0) 推荐(0)

JNI,C++,终于调试通过

摘要: 第一步,写hello.java第二步,执行javac hello.java第三步,执行javah -jni hello(如果写成hello.class会报错),生成hello.h第四步,创建一个C++的dll,比如叫hello第五步,将hello.h,jni.h,jni_md.h拷贝到hello工程目录下,添加进工程里第六步,修改hello工程中的hello.h中的#include <jni.h>成#include "jni.h"第七步,在hello工程中添加hello.cpp,在hello.cpp添加#include "hello.h",把 阅读全文

posted @ 2012-05-03 10:27 哥是技术人 阅读(234) 评论(0) 推荐(0)

Hbase测试&打补丁(HBASE-5415.patch)

摘要: 操作系统:CentOSHbase版本:0.92.0(1)下载到/opt目录下,解压缩,改名后:/opt/hbase(2)修改配置/opt/hbase/conf/hbase-env.sh,填写JDK目录:export JAVA_HOME=/opt/jdk(3)修改配置/opt/hbase/conf/hbase-site.xml<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="configuration.xsl"?><configurati 阅读全文

posted @ 2012-05-03 10:26 哥是技术人 阅读(719) 评论(0) 推荐(0)

导航