このコードの何が問題になっていますか? :
ByteBuffer byteBuffer = ByteBuffer.allocate(4);
FileChannel channel = cacheFile.getChannel();
int bytesCount = channel.read(byteBuffer, offset);
int value = byteBuffer.getInt();
最後の行は常に BufferUnderflowException をスローします。変数 bytesCount には 4 が含まれます。
ここで何が恋しいですか?