Feature #12008
implement Progress.IO.FileOutputStream
Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:
0%
billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:
reviewer:
production:
No
env_name:
topics:
Related issues
History
#1 Updated by Greg Shah 19 days ago
Implement Progress.IO.FileOutputStream¶
Project: Base Language
Related: #9488 (built-in OO classes), #4658 (OO serialization)
Problem¶
Progress.IO.FileOutputStream is a native built-in class, not ADE 4GL source, so #9488 cannot convert it. FWD's com.goldencode.p2j.oo.io package has InputStream, FileInputStream, OutputStream, MemoryOutputStream and ByteOrder. It has no FileOutputStream, and no MemoryInputStream either.
- ADE conversion (#9488). The ADE logging framework writes through it in
OpenEdge.Logging.Writer.NamedFileWriter,OpenEdge.Logging.Writer.FileLogWriterBuilderandOpenEdge.Logging.Filter.LogFilterBuilder. So doesOpenEdge.DataAdmin.Util.DomainSystemExport. Those classes will not compile in FWD without it. - OO serialization (#4658). It is the usual target stream for
Progress.IO.BinarySerializerandProgress.IO.JsonSerializerwhen an object is serialized to a file.
API (OpenEdge 12.8 skeleton)¶
class Progress.IO.FileOutputStream inherits Progress.IO.OutputStream final: constructor public FileOutputStream (fileName as character). constructor public FileOutputStream (fileName as character, append as logical). define public property Append as logical no-undo public get. private set. define public property FileName as character no-undo public get. private set. method public override void Close (). method public override void Flush (). method public override int64 Write (source as longchar). method public override int64 Write (source as character). method public override int64 Write (source as memptr, offset as int64, length as int64). end.
Work¶
- Implement the class in
com.goldencode.p2j.oo.io, usingFileInputStreamas the model for the structure and annotations. The file must be opened through FWD's file system layer, so that it is created where the 4GL session would create it: on the FWD client, relative to the session's working directory, withPROPATHnot consulted. - Establish the OpenEdge behaviour and error numbers for each of the following, and match them:
- opening a file that cannot be created;
- writing after
Close; - closing twice;
- an offset or length outside the bounds of the memptr.
- Establish which codepage
Write(character)andWrite(longchar)use. The candidates are-cpstream,-cpinternaland the longchar's own codepage. - Implement
MemoryInputStreamat the same time if it is small. It is the read-side counterpart ofMemoryOutputStream, and #4658 will probably need it to deserialize from memory. - Annotate both classes with accurate
LegacyResourceSupportlevels.
Testcases¶
Write the tests against OpenEdge 12.8. Cover:- both constructors, including append onto an existing file;
- each
Writeoverload with ASCII and non-ASCII data, checking the bytes on disk; - the
FlushandClosebehaviour, and the error cases listed above; - a round trip of writing with
FileOutputStreamand reading back withFileInputStream.
#2 Updated by Greg Shah 19 days ago
- Related to Feature #9488: implement all built-in OO classes using the open source ADE code from 12.8.4 added
#3 Updated by Greg Shah 19 days ago
- Related to Feature #4658: OO serialization support added