Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java: Where can I find advanced file manipulation source/libraries?

Tags:

java

file-io

I'm writing arbitrary byte arrays (mock virus signatures of 32 bytes) into arbitrary files, and I need code to overwrite a specific file given an offset into the file. My specific question is: is there source code/libraries that I can use to perform this particular task?

I've had this problem with Python file manipulation as well. I'm looking for a set of functions that can kill a line, cut/copy/paste, etc. My assumptions are that these are extremely common tasks, and I couldn't find it in the Java API nor my google searches.

Sorry for not RTFM well; I haven't come across any information, and I've been looking for a while now.

like image 869
montooner Avatar asked Aug 08 '26 01:08

montooner


1 Answers

Maybe you are looking for something like the RandomAccessFile class in the standard Java JDK. It supports reads and writes at some offset, as well as byte arrays.

like image 130
MicSim Avatar answered Aug 10 '26 14:08

MicSim