fixed the '\0' bug in GstoreConnector.recv()

This commit is contained in:
Caesar11 2014-12-11 02:12:16 -05:00
parent 98eb1be60c
commit 49ad0c5493
2 changed files with 3 additions and 2 deletions

Binary file not shown.

View File

@ -207,7 +207,7 @@ public class GstoreConnector
int context_len = GstoreConnector.byte4ToInt(head);
// in Java String, there is no need for terminator '\0' in C. so we should omit '\0' at the end of receiving message.
byte[] data_context = new byte[context_len];
byte[] data_context = new byte[context_len - 1];
int recv_len = 0;
do
{
@ -293,7 +293,8 @@ public class GstoreConnector
+ "?x <cdblp.cn/schema/property/has_author> <cdblp.cn/author/Íõɺ>. "
+ "}";
gc.load("db_cdblp");
boolean flag = gc.load("db_cdblp");
System.out.println(flag);
String answer = gc.query(sparql);
System.out.println(answer);