@@ -2,7 +2,7 @@ local javoc = require("umfal")("javoc")
22
33local constantPoolHandler = javoc .util .handlerFactory .getEmptyHandler ()
44local debugPrint = javoc .util .debug .print
5- local binaryStream = javoc .util .binaryStream
5+ local binaryUtils = javoc .util .binaryUtils
66
77local bit32 = require (" bit32" )
88
@@ -17,11 +17,11 @@ constantPoolHandler[1] = function(stream)
1717 constant .type = " Utf8"
1818 constant .value = " "
1919
20- local length = binaryStream .readU2 (stream )
20+ local length = binaryUtils .readU2 (stream )
2121
2222 -- TODO: Implement proper UTF8 loading
2323 for i = 1 , length do
24- constant .value = constant .value .. string.char (binaryStream .readU1 (stream ))
24+ constant .value = constant .value .. string.char (binaryUtils .readU1 (stream ))
2525 end
2626
2727 debugPrint (" Utf8 constant." )
3939constantPoolHandler [3 ] = function (stream )
4040 local constant = {}
4141 constant .type = " Integer"
42- constant .value = binaryStream .readU4 (stream )
42+ constant .value = binaryUtils .readU4 (stream )
4343
4444 debugPrint (" Integer constant." )
4545 debugPrint (" Value - " .. constant .value )
@@ -76,8 +76,8 @@ constantPoolHandler[5] = function(stream)
7676 local constant = {}
7777 constant .type = " Long"
7878
79- local highBytes = binaryStream .readU4 (stream )
80- local lowBytes = binaryStream .readU4 (stream )
79+ local highBytes = binaryUtils .readU4 (stream )
80+ local lowBytes = binaryUtils .readU4 (stream )
8181
8282 -- value = (highBytes << 32) + lowBytes
8383 constant .value = bit32.lshift (highBytes , 32 ) + lowBytes
@@ -123,7 +123,7 @@ constantPoolHandler[7] = function(stream)
123123 local constant = {}
124124 constant .type = " Class"
125125
126- constant .nameIndex = binaryStream .readU2 (stream )
126+ constant .nameIndex = binaryUtils .readU2 (stream )
127127
128128 debugPrint (" Class constant." )
129129 debugPrint (" Name index - " .. constant .nameIndex )
@@ -140,7 +140,7 @@ constantPoolHandler[8] = function(stream)
140140 local constant = {}
141141 constant .type = " String"
142142
143- constant .stringIndex = binaryStream .readU2 (stream )
143+ constant .stringIndex = binaryUtils .readU2 (stream )
144144
145145 debugPrint (" String constant." )
146146 debugPrint (" Utf8 index - " .. constant .stringIndex )
@@ -158,8 +158,8 @@ constantPoolHandler[9] = function(stream)
158158 local constant = {}
159159 constant .type = " Fieldref"
160160
161- constant .classIndex = binaryStream .readU2 (stream )
162- constant .nameAndTypeIndex = binaryStream .readU2 (stream )
161+ constant .classIndex = binaryUtils .readU2 (stream )
162+ constant .nameAndTypeIndex = binaryUtils .readU2 (stream )
163163
164164 debugPrint (" Fieldref constant" )
165165 debugPrint (" Class index - " .. constant .classIndex )
@@ -178,8 +178,8 @@ constantPoolHandler[10] = function(stream)
178178 local constant = {}
179179 constant .type = " Methodref"
180180
181- constant .classIndex = binaryStream .readU2 (stream )
182- constant .nameAndTypeIndex = binaryStream .readU2 (stream )
181+ constant .classIndex = binaryUtils .readU2 (stream )
182+ constant .nameAndTypeIndex = binaryUtils .readU2 (stream )
183183
184184 debugPrint (" Methodref constant" )
185185 debugPrint (" Class index - " .. constant .classIndex )
@@ -198,8 +198,8 @@ constantPoolHandler[11] = function(stream)
198198 local constant = {}
199199 constant .type = " InterfaceMethodref"
200200
201- constant .classIndex = binaryStream .readU2 (stream )
202- constant .nameAndTypeIndex = binaryStream .readU2 (stream )
201+ constant .classIndex = binaryUtils .readU2 (stream )
202+ constant .nameAndTypeIndex = binaryUtils .readU2 (stream )
203203
204204 debugPrint (" InterfaceMethodref constant" )
205205 debugPrint (" Class index - " .. constant .classIndex )
@@ -218,8 +218,8 @@ constantPoolHandler[12] = function(stream)
218218 local constant = {}
219219 constant .type = " NameAndType"
220220
221- constant .nameIndex = binaryStream .readU2 (stream )
222- constant .descriptorIndex = binaryStream .readU2 (stream )
221+ constant .nameIndex = binaryUtils .readU2 (stream )
222+ constant .descriptorIndex = binaryUtils .readU2 (stream )
223223
224224 debugPrint (" NameAndType constant" )
225225 debugPrint (" Name index - " .. constant .nameIndex )
0 commit comments