public JsonToken peek() throws IOException {
    int p = peeked;
    if (p == PEEKED_NONE) {
      p = doPeek();
    }

    switch (p) {
    case PEEKED_BEGIN_OBJECT:
      return JsonToken.BEGIN_OBJECT;
    case PEEKED_END_OBJECT:
      return JsonToken.END_OBJECT;
    case PEEKED_BEGIN_ARRAY:
      return JsonToken.BEGIN_ARRAY;
    case PEEKED_END_ARRAY:
      return JsonToken.END_ARRAY;
    case PEEKED_SINGLE_QUOTED_NAME:
    case PEEKED_DOUBLE_QUOTED_NAME:
    case PEEKED_UNQUOTED_NAME:
      return JsonToken.NAME;
    case PEEKED_TRUE:
    case PEEKED_FALSE:
      return JsonToken.BOOLEAN;
    case PEEKED_NULL:
      return JsonToken.NULL;
    case PEEKED_SINGLE_QUOTED:
    case PEEKED_DOUBLE_QUOTED:
    case PEEKED_UNQUOTED:
    case PEEKED_BUFFERED:
      return JsonToken.STRING;
    case PEEKED_LONG:
    case PEEKED_NUMBER:
      return JsonToken.NUMBER;
    case PEEKED_EOF:
      return JsonToken.END_DOCUMENT;
    default:
      throw new AssertionError();
    }
  }
public JsonToken peek ( ) throws IOException { int p = peeked ; if ( p == PEEKED_NONE ) { p = doPeek ( ) ; } switch ( p ) { case PEEKED_BEGIN_OBJECT : return JsonToken . BEGIN_OBJECT ; case PEEKED_END_OBJECT : return JsonToken . END_OBJECT ; case PEEKED_BEGIN_ARRAY : return JsonToken . BEGIN_ARRAY ; case PEEKED_END_ARRAY : return JsonToken . END_ARRAY ; case PEEKED_SINGLE_QUOTED_NAME : case PEEKED_DOUBLE_QUOTED_NAME : case PEEKED_UNQUOTED_NAME : return JsonToken . NAME ; case PEEKED_TRUE : case PEEKED_FALSE : return JsonToken . BOOLEAN ; case PEEKED_NULL : return JsonToken . NULL ; case PEEKED_SINGLE_QUOTED : case PEEKED_DOUBLE_QUOTED : case PEEKED_UNQUOTED : case PEEKED_BUFFERED : return JsonToken . STRING ; case PEEKED_LONG : case PEEKED_NUMBER : return JsonToken . NUMBER ; case PEEKED_EOF : return JsonToken . END_DOCUMENT ; default : throw new AssertionError ( ) ; } }
Returns the type of the next token without consuming it.