java - Why there is a confilict between what you see open a file and what input by ByteBuffer -


 for(int i=0; i<10; i++){      array[i] = (char)('a'+i);  }      randomaccessfile rf = new randomaccessfile("data1.txt", "rw");     filechannel fc = rf.getchannel();     bytebuffer buffer = null;     buffer = bytebuffer.allocate(1024);     for(int i=0; i<10; i++){                     buffer.putint((int) array[i]);                   }         buffer.flip();     fc.write(buffer);  

above code, try write 97,98...into file , when read bytebuffer , print screen appears 97,98,...

but when open file appears a,b,c.....

why


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -