Package org.elasticsearch.common.io.stream

Examples of org.elasticsearch.common.io.stream.BytesStreamInput


                Metadata metadata = new Metadata();

                String parsedContent;
                try {
                    // Set the maximum length of strings returned by the parseToString method, -1 sets no limit
                    parsedContent = tika().parseToString(new BytesStreamInput(data, false), metadata, indexedChars);
                } catch (Throwable e) {
                    logger.debug("Failed to extract [" + indexedChars + "] characters of text for [" + filename + "]", e);
                    parsedContent = "";
                }
View Full Code Here


  @Test
  public void testReadFromWriteToSingleton() throws IOException {
    GeoCluster expected = new GeoCluster(DENVER);
    BytesStreamOutput out = new BytesStreamOutput();
    expected.writeTo(out);
    BytesStreamInput in = new BytesStreamInput(out.bytes());
    GeoCluster actual = GeoCluster.readFrom(in);
    assertThat("Center", actual.center(), closeTo(DENVER));
    assertThat("Bounds", actual.bounds(), equalTo(new GeoBoundingBox(DENVER)));
  }
View Full Code Here

  @Test
  public void testReadFromWriteTo() throws IOException {
    GeoCluster expected = new GeoCluster(42, DENVER, COLORADO);
    BytesStreamOutput out = new BytesStreamOutput();
    expected.writeTo(out);
    BytesStreamInput in = new BytesStreamInput(out.bytes());
    GeoCluster actual = GeoCluster.readFrom(in);
    assertThat("Center", actual.center(), closeTo(DENVER));
    assertThat("Bounds", actual.bounds(), equalTo(COLORADO));
  }
View Full Code Here

  @Test
  public void testReadFromWriteTo() throws IOException {
    BytesStreamOutput out = new BytesStreamOutput();
    GeoPoints.writeTo(LAS_VEGAS, out);
    BytesStreamInput in = new BytesStreamInput(out.bytes());
    GeoPoint point = GeoPoints.readFrom(in);
    assertThat("Latitude", point.lat(), equalTo(LAS_VEGAS.lat()));
    assertThat("Longitude", point.lon(), equalTo(LAS_VEGAS.lon()));
  }
View Full Code Here

TOP

Related Classes of org.elasticsearch.common.io.stream.BytesStreamInput

Copyright © 2018 www.massapicom. 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.