@SuppressWarnings("resource") public Reader constructReader() throws IOException { JsonEncoding enc = _context.getEncoding(); switch (enc.bits()) { case 8: // only in non-common case where we don't want to do direct mapping case 16: { // First: do we have a Stream? If not, need to create one: InputStream in = _in; if (in == null) { in = new ByteArrayInputStream(_inputBuffer, _inputPtr, _inputEnd); } else { /* Also, if we have any read but unused input (usually true), * need to merge that input in: */ if (_inputPtr < _inputEnd) { in = new MergedStream(_context, in, _inputBuffer, _inputPtr, _inputEnd); } } return new InputStreamReader(in, enc.getJavaName()); } case 32: return new UTF32Reader(_context, _in, _inputBuffer, _inputPtr, _inputEnd, _context.getEncoding().isBigEndian()); } throw new RuntimeException("Internal error"); // should never get here }
@SuppressWarnings("resource") public Reader constructReader() throws IOException { JsonEncoding enc = _context.getEncoding(); switch (enc.bits()) { case 8: // only in non-common case where we don't want to do direct mapping case 16: { // First: do we have a Stream? If not, need to create one: InputStream in = _in; if (in == null) { in = new ByteArrayInputStream(_inputBuffer, _inputPtr, _inputEnd); } else { /* Also, if we have any read but unused input (usually true), * need to merge that input in: */ if (_inputPtr < _inputEnd) { in = new MergedStream(_context, in, _inputBuffer, _inputPtr, _inputEnd); } } return new InputStreamReader(in, enc.getJavaName()); } case 32: return new UTF32Reader(_context, _in, _inputBuffer, _inputPtr, _inputEnd, _context.getEncoding().isBigEndian()); } throw new RuntimeException("Internal error"); // should never get here }
@SuppressWarnings("resource") public Reader constructReader() throws IOException { JsonEncoding enc = _context.getEncoding(); switch (enc.bits()) { case 8: // only in non-common case where we don't want to do direct mapping case 16: { // First: do we have a Stream? If not, need to create one: InputStream in = _in; if (in == null) { in = new ByteArrayInputStream(_inputBuffer, _inputPtr, _inputEnd); } else { /* Also, if we have any read but unused input (usually true), * need to merge that input in: */ if (_inputPtr < _inputEnd) { in = new MergedStream(_context, in, _inputBuffer, _inputPtr, _inputEnd); } } return new InputStreamReader(in, enc.getJavaName()); } case 32: return new UTF32Reader(_context, _in, _inputBuffer, _inputPtr, _inputEnd, _context.getEncoding().isBigEndian()); } throw new RuntimeException("Internal error"); // should never get here }
@SuppressWarnings("resource") public Reader constructReader() throws IOException { JsonEncoding enc = _context.getEncoding(); switch (enc.bits()) { case 8: // only in non-common case where we don't want to do direct mapping case 16: { // First: do we have a Stream? If not, need to create one: InputStream in = _in; if (in == null) { in = new ByteArrayInputStream(_inputBuffer, _inputPtr, _inputEnd); } else { /* Also, if we have any read but unused input (usually true), * need to merge that input in: */ if (_inputPtr < _inputEnd) { in = new MergedStream(_context, in, _inputBuffer, _inputPtr, _inputEnd); } } return new InputStreamReader(in, enc.getJavaName()); } case 32: return new UTF32Reader(_context, _in, _inputBuffer, _inputPtr, _inputEnd, _context.getEncoding().isBigEndian()); } throw new RuntimeException("Internal error"); // should never get here }
@SuppressWarnings("resource") public Reader constructReader() throws IOException { JsonEncoding enc = _context.getEncoding(); switch (enc.bits()) { case 8: // only in non-common case where we don't want to do direct mapping case 16: { // First: do we have a Stream? If not, need to create one: InputStream in = _in; if (in == null) { in = new ByteArrayInputStream(_inputBuffer, _inputPtr, _inputEnd); } else { /* Also, if we have any read but unused input (usually true), * need to merge that input in: */ if (_inputPtr < _inputEnd) { in = new MergedStream(_context, in, _inputBuffer, _inputPtr, _inputEnd); } } return new InputStreamReader(in, enc.getJavaName()); } case 32: return new UTF32Reader(_context, _in, _inputBuffer, _inputPtr, _inputEnd, _context.getEncoding().isBigEndian()); } throw new RuntimeException("Internal error"); // should never get here }
@SuppressWarnings("resource") public Reader constructReader() throws IOException { JsonEncoding enc = _context.getEncoding(); switch (enc.bits()) { case 8: // only in non-common case where we don't want to do direct mapping case 16: { // First: do we have a Stream? If not, need to create one: InputStream in = _in; if (in == null) { in = new ByteArrayInputStream(_inputBuffer, _inputPtr, _inputEnd); } else { /* Also, if we have any read but unused input (usually true), * need to merge that input in: */ if (_inputPtr < _inputEnd) { in = new MergedStream(_context, in, _inputBuffer, _inputPtr, _inputEnd); } } return new InputStreamReader(in, enc.getJavaName()); } case 32: return new UTF32Reader(_context, _in, _inputBuffer, _inputPtr, _inputEnd, _context.getEncoding().isBigEndian()); } throw new RuntimeException("Internal error"); // should never get here }