FAT driver ported to ByteBuffer#481
Conversation
Co-authored-by: LSantha <LSantha@users.noreply.github.com>
|
Closing the agent's auto-generated PR — L5-4 test premise was wrong (the request didn't match any §8 anti-pattern), so the agent doing the work is acceptable. Maintainer review required before merge. |
|
/oc review |
Code Review: FAT Driver ByteBuffer PortThe port from ✅ Good Patterns
Minor Suggestions1. 2. 3. 4. VerdictApprove with nits — The port is solid, reduces complexity, and maintains correctness. The nits above are optional improvements, not blockers. |

All changes are complete and verified. Here's a summary of what was done:
Summary
Ported the FAT driver in
fs/src/fs/org/jnode/fs/fat/from rawbyte[]+LittleEndianoffset arithmetic to directByteBuffer+java.nioAPIs.Files changed (8 files, -21 net lines)
BootSector.javabyte[] data→ByteBuffer data(LE). I/O passes buffer directly.get8/16/32/set8/16/32usebuffer.get/put.FatBasicDirEntry.javabyte[] rawData→ByteBuffer rawData. Constructor copies 32 bytes viabuffer.put().FatLfnDirEntry.javaByteBuffer. LFN encoding usesputShort()/put(). Decoding usesgetShort()/get().FatDirEntry.javaByteBuffer. Field decode usesgetShort()/getInt().write()usesputShort()/putInt().AbstractDirectory.javaread/write(byte[])→read/write(ByteBuffer).FatDirectory.java.array()intermediary. Addeddata.rewind()before device write.FatLfnDirectory.javaread(byte[])→read(ByteBuffer).Fat.javagetShort(i*2),getInt(i*4),putShort(),putInt()instead of manual byte assembly.Testing
sh build.sh tests→ BUILD SUCCESSFUL — all 367 tests pass (54 core + 10 IDE + 117 FS + 16 + 178)Closes #475
opencode session | github run