For a while I looked around and I am a little confused by this problem. I want to be able to receive an input stream and read it simultaneously in segments. Segments do not interact with each other, but represent only the values that need to be inserted or updated in the database from the downloaded file. Is it possible to read the input stream at the same time, setting the segment size, and then just skip ahead before unscrewing the new stream to process the conversion and insert / update?
In fact, the file is a list of IDs (one identifier per line), although it would be preferable if I could specify a separator. Some files can be huge, so I would like to process and convert the data into segments, so that after inserting / updating the database, I can free up the JVM memory. Is it possible? And if there are any libraries that already do this?
Greetings and thanks in advance,
Alexey Blue.
source
share