Examples of readFrom()


Examples of org.apache.wink.common.internal.providers.entity.atom.AtomFeedProvider.readFrom()

                client.resource(MessageFormat.format(SERVICE_URL, String.valueOf(server
                    .getServerPort())));

            AtomFeedProvider afp = new AtomFeedProvider();
            AtomFeed entryToPost =
                afp.readFrom(AtomFeed.class,
                             null,
                             null,
                             MediaType.APPLICATION_ATOM_XML_TYPE,
                             null,
                             new ByteArrayInputStream(FEED.getBytes()));
View Full Code Here

Examples of org.apache.zookeeper.server.ServerConfig.readFrom()

      final TestZookeeperServerIntern server = new TestZookeeperServerIntern();
      try {
         QuorumPeerConfig qpConfig = new QuorumPeerConfig();
         qpConfig.parseProperties(zkConfig);
         final ServerConfig sConfig = new ServerConfig();
         sConfig.readFrom(qpConfig);
        
         Thread t = new Thread(new Runnable() {
        
            @Override
            public void run()  {  try { server.runFromConfig(sConfig); } catch(IOException ioe ) { logger.error(MarkerFactory.getMarker("FATAL"), "", ioe); fail("can't start zookeeper"); } }
View Full Code Here

Examples of org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider.readFrom()

       
        // call the provider as though the wink-client was in use on the client side
        InputStream is = new ByteArrayInputStream(response.getContentAsByteArray());
        // use JacksonJaxbJsonProvider with default configuration instead of the old JacksonJsonProvider
        JacksonJaxbJsonProvider jacksonJAXBProvider = new JacksonJaxbJsonProvider();
        MyJAXBObject myJAXBObject = (MyJAXBObject)jacksonJAXBProvider.readFrom(Object.class, MyJAXBObject.class, null, MediaType.APPLICATION_JSON_TYPE, null, is);

        // make sure the Jackson deserializer is using the 'type' property on the XmlElement annotation in MyJAXBObject
        // confirm Jackson deserialized to expected object type -- support for this was added in Jackson 1.4
        assertTrue(myJAXBObject.getConfiguration() instanceof MyProperties);
    }
View Full Code Here

Examples of org.codehaus.jackson.jaxrs.JacksonJsonProvider.readFrom()

                new JSONObject(response.getContentAsString())));
       
        // call the provider as though the wink-client was in use on the client side
        InputStream is = new ByteArrayInputStream(response.getContentAsByteArray());
        JacksonJsonProvider jacksonProvider = new JacksonJsonProvider();
        Animal animal = (Animal)jacksonProvider.readFrom(Object.class, Animal.class, null, MediaType.APPLICATION_JSON_TYPE, null, is);
       
        // make sure pseudo polymorphism support works.  See Animal class with @JsonCreator and @JsonProperty annotations
        assertEquals(Dog.class, animal.getClass());

    }
View Full Code Here

Examples of org.eclipse.jetty.io.Buffer.readFrom()

                LOG.warn("invalid resource: "+String.valueOf(resource)+" "+len);
                return null;
            }
            Buffer buffer = new IndirectNIOBuffer(len);
            InputStream is = resource.getInputStream();
            buffer.readFrom(is,len);
            is.close();
            return buffer;
        }
        catch(IOException e)
        {
View Full Code Here

Examples of org.eclipse.jetty.io.ByteArrayBuffer.readFrom()

            {
                if (_resource.length() <= 0 || _maxBuffer < _resource.length())
                    return null;
                ByteArrayBuffer buffer = new ByteArrayBuffer((int)_resource.length());
                inputStream = _resource.getInputStream();
                buffer.readFrom(inputStream,(int)_resource.length());
                return buffer;
            }
            catch (IOException e)
            {
                throw new RuntimeException(e);
View Full Code Here

Examples of org.eclipse.jetty.io.nio.DirectNIOBuffer.readFrom()

                LOG.warn("invalid resource: "+String.valueOf(resource)+" "+len);
                return null;
            }
            Buffer buffer = new DirectNIOBuffer(len);
            InputStream is = resource.getInputStream();
            buffer.readFrom(is,len);
            is.close();
            return buffer;
        }
        catch(IOException e)
        {
View Full Code Here

Examples of org.eclipse.jetty.io.nio.IndirectNIOBuffer.readFrom()

                LOG.warn("invalid resource: "+String.valueOf(resource)+" "+len);
                return null;
            }
            Buffer buffer = new IndirectNIOBuffer(len);
            InputStream is = resource.getInputStream();
            buffer.readFrom(is,len);
            is.close();
            return buffer;
        }
        catch(IOException e)
        {
View Full Code Here

Examples of org.elasticsearch.action.delete.DeleteRequest.readFrom()

                IndexRequest request = new IndexRequest();
                request.readFrom(in);
                requests.add(request);
            } else if (type == 1) {
                DeleteRequest request = new DeleteRequest();
                request.readFrom(in);
                requests.add(request);
            }
        }
        refresh = in.readBoolean();
    }
View Full Code Here

Examples of org.elasticsearch.action.index.IndexRequest.readFrom()

        int size = in.readVInt();
        for (int i = 0; i < size; i++) {
            byte type = in.readByte();
            if (type == 0) {
                IndexRequest request = new IndexRequest();
                request.readFrom(in);
                requests.add(request);
            } else if (type == 1) {
                DeleteRequest request = new DeleteRequest();
                request.readFrom(in);
                requests.add(request);
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.