title: Retrofit with moshi throwing EOFException
body: <p>In my project i am using Retrofit along side moshi to parse the json server responses.</p>
  
  <p>I created a generic wrapper class for the server response</p>
  
  <pre><code>@JsonClass(generateAdapter = true)
  data class ResultsResponse&lt;out T&gt;(
      @field:Json(name = "data")
      val results: List&lt;T&gt;
  )
  </code></pre>
  
  <p>and this is the class for the actual data of the json</p>
  
  <pre><code>@Parcelize
  @JsonClass(generateAdapter = true)
  data class Teacher(
      @field:Json(name = "id") override val id: Int,
      @field:Json(name = "profile") val profile: Profile?,
      @field:Json(name = "company") val company: Company?,
      @field:Json(name = "organization") val organization: Organization?
  ) 
  </code></pre>
  
  <p>Which i use as the return value for each of the retrofit interface functions</p>
  
  <pre><code>@GET("teachers/{id}")
      suspend fun getTeacher(
          @Path("id") id: Int,
          @Query("include") relations: String = "",
          @QueryMap query: Map&lt;String, String&gt; = mapOf()
      ): Response&lt;ResultResponse&lt;Teacher&gt;&gt;
  </code></pre>
  
  <p>Most of the times the json is parsed ok but there are times that Moshi throws the following 
  exception</p>
  
  <pre><code>W/System.err: java.io.EOFException: End of input
          at com.squareup.moshi.JsonUtf8Reader.nextNonWhitespace(JsonUtf8Reader.java:1057)
          at com.squareup.moshi.JsonUtf8Reader.doPeek(JsonUtf8Reader.java:252)
  W/System.err:     at com.squareup.moshi.JsonUtf8Reader.hasNext(JsonUtf8Reader.java:185)
          at com.adelve.findmyteacher.data.models.network_responses.ResultsResponseJsonAdapter.fromJson(ResultsResponseJsonAdapter.kt:35)
          at com.adelve.findmyteacher.data.models.network_responses.ResultsResponseJsonAdapter.fromJson(ResultsResponseJsonAdapter.kt:20)
          at com.squareup.moshi.internal.NullSafeJsonAdapter.fromJson(NullSafeJsonAdapter.java:40)
          at com.squareup.moshi.JsonAdapter$2.fromJson(JsonAdapter.java:161)
          at retrofit2.converter.moshi.MoshiResponseBodyConverter.convert(MoshiResponseBodyConverter.java:45)
          at retrofit2.converter.moshi.MoshiResponseBodyConverter.convert(MoshiResponseBodyConverter.java:27)
          at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:227)
          at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:142)
          at okhttp3.RealCall$AsyncCall.run(RealCall.kt:140)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
          at java.lang.Thread.run(Thread.java:764)
  </code></pre>
  
  <p>Is it possible that Moshi does not go well with the generic wrapper class i use and need to create a custom one? Or is the issue somewhere else. This exception occurs on average 4/10 network calls. I cant seem to find why this exception is being throw. </p>