Examples of readChars()


Examples of com.firefly.utils.json.io.JsonStringReader.readChars()

 
  @Test
  public void testSkipValue() throws IOException {
    JsonReader reader = new JsonStringReader("{ \"testField\": null, \"ssdd\" : \"sdf\\\"sdfsdf\" }");
    Assert.assertThat(reader.isObject(), is(true));
    Assert.assertThat(Arrays.equals("testField".toCharArray(), reader.readChars()), is(true));
    Assert.assertThat(reader.isColon(), is(true));
    reader.skipValue();
   
    Assert.assertThat(reader.isComma(), is(true));
    Assert.assertThat(Arrays.equals("ssdd".toCharArray(), reader.readChars()), is(true));
View Full Code Here

Examples of com.firefly.utils.json.io.JsonStringReader.readChars()

    Assert.assertThat(Arrays.equals("testField".toCharArray(), reader.readChars()), is(true));
    Assert.assertThat(reader.isColon(), is(true));
    reader.skipValue();
   
    Assert.assertThat(reader.isComma(), is(true));
    Assert.assertThat(Arrays.equals("ssdd".toCharArray(), reader.readChars()), is(true));
    Assert.assertThat(reader.isColon(), is(true));
    reader.skipValue();
    reader.close();
  }
 
View Full Code Here

Examples of com.firefly.utils.json.io.JsonStringReader.readChars()

 
  @Test
  public void testSkipValue2() throws IOException {
    JsonReader reader = new JsonStringReader("{ \"testField\": [ [[2 , 3],[3]], [[3,4]] ], \"ssdd\" : \"sdf\\\"sdfsdf\" }");
    Assert.assertThat(reader.isObject(), is(true));
    Assert.assertThat(Arrays.equals("testField".toCharArray(), reader.readChars()), is(true));
    Assert.assertThat(reader.isColon(), is(true));
    reader.skipValue();
   
    Assert.assertThat(reader.isComma(), is(true));
    Assert.assertThat(Arrays.equals("ssdd".toCharArray(), reader.readChars()), is(true));
View Full Code Here

Examples of com.firefly.utils.json.io.JsonStringReader.readChars()

    Assert.assertThat(Arrays.equals("testField".toCharArray(), reader.readChars()), is(true));
    Assert.assertThat(reader.isColon(), is(true));
    reader.skipValue();
   
    Assert.assertThat(reader.isComma(), is(true));
    Assert.assertThat(Arrays.equals("ssdd".toCharArray(), reader.readChars()), is(true));
    Assert.assertThat(reader.isColon(), is(true));
    reader.skipValue();
    reader.close();
  }
 
View Full Code Here

Examples of org.apache.lucene.store.IndexInput.readChars()

                localFieldsStream.readBytes(bytes, 0, toRead);
                fieldsData = new String(bytes, "UTF-8");
              } else {
                //read in chars b/c we already know the length we need to read
                char[] chars = new char[toRead];
                localFieldsStream.readChars(chars, 0, toRead);
                fieldsData = new String(chars);
              }
            }
          } catch (IOException e) {
            throw new FieldReaderException(e);
View Full Code Here

Examples of org.apache.lucene.store.IndexInput.readChars()

                localFieldsStream.readBytes(bytes, 0, toRead);
                value = new String(bytes, "UTF-8");
              } else {
                //read in chars b/c we already know the length we need to read
                char[] chars = new char[toRead];
                localFieldsStream.readChars(chars, 0, toRead);
                value = new String(chars);
              }
            }
          } catch (IOException e) {
            throw new FieldReaderException(e);
View Full Code Here

Examples of org.apache.lucene.store.IndexInput.readChars()

                localFieldsStream.readBytes(bytes, 0, toRead);
                value = new String(bytes, "UTF-8");
              } else {
                //read in chars b/c we already know the length we need to read
                char[] chars = new char[toRead];
                localFieldsStream.readChars(chars, 0, toRead);
                value = new String(chars);
              }
            }
          } catch (IOException e) {
            throw new FieldReaderException(e);
View Full Code Here

Examples of org.apache.lucene.store.IndexInput.readChars()

            localFieldsStream.readBytes(b, 0, b.length);
            fieldsData = new String(uncompress(b), "UTF-8");
          } else {
            //read in chars b/c we already know the length we need to read
            char[] chars = new char[toRead];
            localFieldsStream.readChars(chars, 0, toRead);
            fieldsData = new String(chars);
          }
        } catch (IOException e) {
          throw new FieldReaderException(e);
        }
View Full Code Here

Examples of org.apache.lucene.store.IndexInput.readChars()

                localFieldsStream.readBytes(bytes, 0, toRead);
                fieldsData = new String(bytes, "UTF-8");
              } else {
                //read in chars b/c we already know the length we need to read
                char[] chars = new char[toRead];
                localFieldsStream.readChars(chars, 0, toRead);
                fieldsData = new String(chars);
              }
            }
          } catch (IOException e) {
            throw new FieldReaderException(e);
View Full Code Here

Examples of org.apache.lucene.store.IndexInput.readChars()

                localFieldsStream.readBytes(bytes, 0, toRead);
                value = new String(bytes, "UTF-8");
              } else {
                //read in chars b/c we already know the length we need to read
                char[] chars = new char[toRead];
                localFieldsStream.readChars(chars, 0, toRead);
                value = new String(chars);
              }
            }
          } catch (IOException e) {
            throw new FieldReaderException(e);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.