MCPcopy Create free account
hub / github.com/Hiro420/NikkeTools / parse

Method parse

UnLuac/src/unluac/parse/LStringType.java:129–153  ·  view source on GitHub ↗
(final ByteBuffer buffer, BHeader header)

Source from the content-addressed store, hash-verified

127class LStringType54 extends LStringType {
128
129 @Override
130 public LString parse(final ByteBuffer buffer, BHeader header) {
131 BInteger sizeT = header.sizeT.parse(buffer, header);
132 final StringBuilder b = this.b.get();
133 b.setLength(0);
134 sizeT.iterate(new Runnable() {
135
136 boolean first = true;
137
138 @Override
139 public void run() {
140 if(!first) {
141 b.append((char) (0xFF & buffer.get()));
142 } else {
143 first = false;
144 }
145 }
146
147 });
148 String s = b.toString();
149 if(header.debug) {
150 System.out.println("-- parsed <string> \"" + s + "\"");
151 }
152 return new LString(s);
153 }
154
155 @Override
156 public void write(OutputStream out, BHeader header, LString string) throws IOException {

Callers

nothing calls this directly

Calls 5

iterateMethod · 0.95
toStringMethod · 0.65
printlnMethod · 0.65
parseMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected