Add support for Memory Mapping and HPGL2 un-terminated commands #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds Memory Mapping and some HPGL2 fixes.
Memory Mapping
Adds support for memory mapping if the input file is <2 GB. It will still fall back to the slow streams if the input is larger.
In my experiments this has had an average performance gain of about 30-50x over the default streams.
Sample performance:
pclFileSize=339509 KB
TotalSeconds= 52.3692026
(After pointing pcl-dumper to the new fork).
Note : there are some excessive comments on the ByteBuffers, which are only used for Standard-in, which is currently only used in testing cases. This code is somehow much more convoluted than the same code for the MappedByteBuffer, for reasons that I never fully understood without staring at the documentation for hours.
HPGL2 Commands without a Terminating Character
Adds support for HPGL2 commands that are not terminated by a ';'.
In those cases, the parser now tries to handle by looking for an escape character and treating it the exact same way as if it were a terminator. This will pass the stream back to the proper handler to receive the exit signal for HPGL2 mode.
(The most common area I have encountered this is output from Oracle Documaker's PCL output. It likes to issue "PW" commands to set the pen width, and never terminates them with a ;. It always reliably issues the esc sequence to return from HPGL2 mode, however.)
Missing HPGL2 Commands
There were three additional HPGL2 commands that were missing.