outBytes.ensure((int)outputByteEnd);
inPtr.p = inBytes.getBegin();
outPtr.p = outBytes.getBegin() + outputByteoffset;
int os = outPtr.p + outputBytesize;
EConvResult res = ec.convert(inBytes.getUnsafeBytes(), inPtr, inBytes.getRealSize() + inPtr.p, outBytes.getUnsafeBytes(), outPtr, os, flags);
outBytes.setRealSize(outPtr.p - outBytes.begin());
if (input != null) {
input.getByteList().setRealSize(inBytes.getRealSize() - (inPtr.p - inBytes.getBegin()));
input.getByteList().setBegin(inPtr.p);
}
if (outputBytesizeObj.isNil() && res == EConvResult.DestinationBufferFull) {
if (Integer.MAX_VALUE / 2 < outputBytesize) {
throw runtime.newArgumentError("too long conversion result");
}
outputBytesize *= 2;
outputByteOffsetObj = context.nil;
continue;
}
if (ec.destinationEncoding != null) {
outBytes.setEncoding(ec.destinationEncoding);
}
return runtime.newSymbol(res.symbolicName());
}
}