Class MapBytes |
Efficiently rearrange bytes in a string. This is a class so that multiple simultaneous rearrangements can be carried out efficiently. Use a different class instance for each different rearrangement.
Handles any transposition that can be expressed in multiples of 256-bytes or less.
Details |
Constructor |
in | Arrangement of bytes found in input string
|
out | Rearrangement of those bytes for output string
|
blockSize | Default size of file read/write operations (bytes).
<i>Adjusted automatically to be a multiple of *in</i>.
|
Create a class instance suitable for transposing bytes in in a string. Efficiently handles large strings.
Methods: |
blockSize | desired block size, may be adjusted internally |
adjusted block size |
Adjust the given blockSize for file reads() to a valid value. Used internally.
s | string to be transposed by map |
a copy of s with the bytes rearranged by map |
mapInFile(inFile, outFile, blockSize)
inFile | Input file (already opened for reading)
|
outFile | Output file (already opened for writing)
|
blockSize | If present, overrides class' blkSize
|
Copy one file to another with mapping (leaves files open).
s | string to be transposed by map inverse |
a copy of s with the bytes rearranged by map inverse |
Reverse the byte rearrangement
mapOutFile(inFile, outFile, blockSize)
inFile | Input file (already opened for reading)
|
outFile | Output file (already opened for writing)
|
blockSize | If present, overrides class' blkSize
|
Copy one file to another with reverse mapping (leaves files open)
Fields: |