.38 irq 22.0
03-10 17:12:55.580: I/dalvikvm(3511): threadid=3: reacting to signal 3
03-10 17:12:55.780: I/dalvikvm(3511): Wrote stack traces to '/data/anr/traces.txt'
03-10 17:12:56.430: I/Process(3511): Sending signal. PID: 3511 SIG: 3
Some extra information, the null pointer exception occurred when the line
InputStream is = serverSocket.getInputStream();
that is at line 7
byte[] recvByte = new byte[1024];
int recv = 0;
while ((recv = is.read(recvByte))!= -1) {
^
if the value of recv is smaller than -1 then it will enter in the while loop.
The problem is that everytime I get a new line in the server, the error occurs.
String recvText = new String(recvByte);
if (recvText.contains("Check the server_file")) {
try {
byte[] fileContent = getBytesFromFile(fileName);
ArrayList newArray = new ArrayList(Arrays.asList(fileContent));
Related links:
コメント