title: Get com.google.gson.stream.MalformedJsonException when reading strings with spaces
body: <p>I'm using Cloud Firestore to store my data. When I try to read data with a space in the string I get the following error message:</p>
  
  <pre><code>    java.lang.reflect.InvocationTargetException
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:564)
      at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:473)
      at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:372)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:564)
      at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:941)
  Caused by: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated object at line 1 column 79
      at com.google.gson.Gson.fromJson(Gson.java:769)
      at POS.Firebase.readCounts(Firebase.java:47)
      at POS.Main.main(Main.java:52)
      ... 11 more
  Caused by: com.google.gson.stream.MalformedJsonException: Unterminated object at line 1 column 79
      at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1298)
      at com.google.gson.stream.JsonReader.nextInObject(JsonReader.java:722)
      at com.google.gson.stream.JsonReader.peek(JsonReader.java:382)
      at com.google.gson.stream.JsonReader.hasNext(JsonReader.java:349)
      at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:169)
      at com.google.gson.Gson.fromJson(Gson.java:755)
      ... 13 more
  </code></pre>
  
  <p>code for getting the data from firebase is</p>
  
  <pre><code>for (DocumentSnapshot documentSnapshot : collection.get().get().getDocuments()) {
              JsonReader reader = new JsonReader(new StringReader(String.valueOf(documentSnapshot.getData())));
              reader.setLenient(true);
              Item item = new Gson().fromJson(reader, Item.class);
              Arrays.itemArrayList.add(item);
          }
  </code></pre>
  
  <p>Is there a way to store the data without adding quotation marks when i enter the data
  <a href="https://i.stack.imgur.com/dDzOP.png" rel="nofollow noreferrer">Data in database</a></p>