My Java program saves its data in a binary file, and (very) from time to time the file becomes damaged due to a hardware failure. Typically, in a file of a few megabytes, only a few bytes are affected. To deal with this problem, I could write the data twice, but it seems unnecessary - I would prefer to limit the increase in file size to about 20%.
It seems to me that this is similar to the problem of sending information over a "noisy" data stream. Is there a library or Java algorithm that can write redundant information to the output stream so that the receiver can recover when noise is input?
What you want is error correction codes. Check out this code: http://freshmeat.net/projects/javafec/
In addition, a Wikipedia article can give you more information: http://en.wikipedia.org/wiki/Forward_error_correction
Your two options are forward error correction, where you send redundant data or an error detection system, where you check the hash value and re-request any data that has been corrupted. If corruption is expected, error correction is an approach.
Without knowing the nature of your environment, providing more specific advice is actually not possible, but you should start by exploring how to approach this problem.
. , log n , , .
, (, ) . , .
: /CRC ( ), () , .
: - , , , .
CRC ECC - ( ECC), - . . / . , , ECC/CRC , .
, :
, , comms ECC ..
, .
, ; - .
, , -, "" ( /, Oil & Gas drilling rig-style). - XMODEM CRC. , , , :
XMODEM
RandomAccessFile "rw", (512-4096 ), CRC, , , . , ?
Source: https://habr.com/ru/post/1725572/More articles:How to call a web service using XDocument? - c #Скремблирующая система Память для строк, соответствующих регулярному выражению в Windows - memoryhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1725569/has-a-relationship-applies-to-inherited-members&usg=ALkJrhjNg8nE1olr9-KEIQhRkMCiSyb3bAJava reads utf-8 encoded file, character by character - javaSave WWW :: Mechanize :: File to disk using FileUtils - ruby | fooobar.comRuby # crypt string in C # and php - stringComputed columns: SQL or locally in the Entity Framework? - performanceJoining two tables using a double-valued column, master -lookup tables - sqlLinux distribution / version for Linux software release support - linuxDynamic options object for jQuery plugin (examples) - jqueryAll Articles