private CloseMethod parseNumber(Consumer<Number> consumer) throws IOException {
        final StringBuilder builder = new StringBuilder();
        
        final CloseMethod method;
        parser: while (true) {
            switch (character) {
                // . (decimal sign)
                case 0x2E : 
                    builder.append('.');
                    return parseNumberDecimal(consumer, builder);
                    
                // - (minus sign)
                case 0x2D : 
                    builder.append('-');
                    next();
                    continue;
                    
                // Digit '0 - 9'
                case 0x30 : case 0x31 : case 0x32 : case 0x33 : case 0x34 :
                case 0x35 : case 0x36 : case 0x37 : case 0x38 : case 0x39 :
                    builder.append(Character.toChars(character));
                    next();
                    continue;
                    
                case 0x7D : // }
                case 0x5D : // ]
                    method = CloseMethod.EXIT_FROM_PARENT;
                    break parser;
                    
                case 0x2C : // ,
                    method = CloseMethod.CONTINUE_IN_PARENT;
                    break parser;
                    
                case 0x0A : // new line
                    row.incrementAndGet();
                    col.set(-1);
                    method = CloseMethod.NOT_DECIDED;
                    break parser;
                    
                case 0x09 : // tab
                    col.addAndGet(TAB_SIZE - 1L);
                    method = CloseMethod.NOT_DECIDED;
                    break parser;
                    
                case 0x20 : // space
                case 0x0D : // return (ignore)
                    method = CloseMethod.NOT_DECIDED;
                    break parser;
                    
                default :
                    throw unexpectedCharacterException();
            }
        }
        
        consumer.accept(Long.parseLong(builder.toString()));
        return method;
    }
Internal class that parses a stream of JSON characters into an object
representation.
<p>
This implementation includes a line and column counter that makes it easier
to debug an erroneous JSON string. These might add additional overhead to the
parsing time and should therefore only be used if the input is expected to
have errors.

@author Emil Forslund
@since  1.0.0
common-parent/json/src/main/java/com/speedment/common/json/internal/JsonDeserializer.java