private static double readDouble(TokenBuffer buffer) {
        try {
            if (buffer.current() == JsonToken.VALUE_STRING) {
                return decodeNumberString(buffer.currentText());
            }
            return Double.parseDouble(buffer.currentText());
        }
        catch (NumberFormatException e) {
            throw new IllegalArgumentException("Expected a number but got '" + buffer.currentText() + "'");
        }
    }
Reads values for a tensor subspace block

@param buffer the buffer containing the values
@param size the expected number of values
@param address the address for the block for error reporting, or null if not known
@param type the type of the tensor we are reading
@return the values read
document/src/main/java/com/yahoo/document/json/readers/TensorReader.java