Sorry for asking so simply question.But I cann't sure my mind about the data file.
Can I use these code to resolve file?And is there any other ways to resolve it without FileChannel?
4 byte numeric, magic cookie value identifies this as a data file
RandomAccessFile file = new RandomAccessFile("f:\\db-2x2.db", "rw");
FileChannel fc = file.getChannel();
MappedByteBuffer mbb = fc.map(FileChannel.MapMode.READ_WRITE, 0, fc.size());
ByteBuffer bb = mbb.get(bytes, 0, 4);
int magicCookie = bb.getInt();