feat: add shared read/write buffer for sequential files (COB_FILE_SEQ_BUFFER_SIZE)#795
Draft
yutaro-sakamoto wants to merge 6 commits intoopensourcecobol:developfrom
Draft
feat: add shared read/write buffer for sequential files (COB_FILE_SEQ_BUFFER_SIZE)#795yutaro-sakamoto wants to merge 6 commits intoopensourcecobol:developfrom
yutaro-sakamoto wants to merge 6 commits intoopensourcecobol:developfrom
Conversation
46f8264 to
d99cc0b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
COB_FILE_SEQ_BUFFER_SIZEthat enables buffering for bothread and write operations on SEQUENTIAL and LINE SEQUENTIAL files
COB_FILE_SEQ_WRITE_BUFFER_SIZE(write-only) is deprecated and used as a fallback whenthe new variable is not set
FileChannel.read()calls
Changes
FileIO.java: Replace separate read/write buffers with a unified buffer using a 3-statemode machine (
BUFFER_MODE_NONE/READ/WRITE). Mode transitions handle flushing(WRITE→READ) and FileChannel position adjustment (READ→WRITE). Also fixes
getc()to returnunsigned byte values (
& 0xFF).CobolUtil.java: RenamefileSeqWriteBufferSize→fileSeqBufferSize. ReadCOB_FILE_SEQ_BUFFER_SIZEfirst, falling back toCOB_FILE_SEQ_WRITE_BUFFER_SIZE. AddNumberFormatExceptionhandling and useCobolUtil.getEnv()for consistency.CobolFile.java: Expand buffer preparation inopen_()from OUTPUT/EXTEND only to all openmodes (INPUT, OUTPUT, I-O, EXTEND).
doc/environment_variables.md/doc/environment_variables_JP.md: AddCOB_FILE_SEQ_BUFFER_SIZEdocumentation and markCOB_FILE_SEQ_WRITE_BUFFER_SIZEas deprecated.tests/misc.src/seq-buffer.at: Add 10 integration tests covering sequential read, linesequential read, buffer size 1, buffer disabled, I-O rewrite, many records, deprecated fallback,
mode transitions, and short records.