Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,43 @@
/* NetRexx */
options replace format comments java crossref symbols nobinary
parse arg inFileName .
if inFileName = '' | inFileName = '.' then inFileName = './data/dwarfs.json'
fileContents = slurp(inFileName)
say fileContents
return
-- Slurp a file and return contents as a Rexx string
method slurp(inFileName) public static returns Rexx
slurped = Rexx null
slurpStr = StringBuilder()
ioBuffer = byte[1024]
inBytes = int 0
do
inFile = File(inFileName)
inFileIS = BufferedInputStream(FileInputStream(inFile))
loop label ioLoop until inBytes = -1
slurpStr.append(String(ioBuffer, 0, inBytes))
inBytes = inFileIS.read(ioBuffer)
end ioLoop
catch exFNF = FileNotFoundException
exFNF.printStackTrace
catch exIO = IOException
exIO.printStackTrace
finally
do
inFileIS.close()
catch ex = IOException
ex.printStackTrace
end
end
slurped = Rexx(slurpStr.toString)
return slurped