Examples of writeBytes()


Examples of org.elasticsearch.common.io.stream.BytesStreamOutput.writeBytes()

    public void testIllegalBulkWrite() throws Exception {
        BytesStreamOutput out = new BytesStreamOutput();

        // bulk-write with wrong args
        try {
            out.writeBytes(new byte[]{}, 0, 1);
            fail("expected IllegalArgumentException: length > (size-offset)");
        }
        catch (IllegalArgumentException iax1) {
            // expected
        }
View Full Code Here

Examples of org.elasticsearch.common.io.stream.StreamOutput.writeBytes()

        }
        if (compress != null && compress && !CompressorFactory.isCompressed(value, 0, value.length)) {
            if (compressThreshold == -1 || value.length > compressThreshold) {
                BytesStreamOutput bStream = new BytesStreamOutput();
                StreamOutput stream = CompressorFactory.defaultCompressor().streamOutput(bStream);
                stream.writeBytes(value, 0, value.length);
                stream.close();
                value = bStream.bytes().toBytes();
            }
        }
        if (fieldType().stored()) {
View Full Code Here

Examples of org.elasticsearch.common.netty.buffer.ChannelBuffer.writeBytes()

                    this.request = new MemcachedRestRequest(RestRequest.Method.POST, args[1], null, Integer.parseInt(args[4]), false);
                    buffer.markReaderIndex();
                } else if ("version".equals(cmd)) { // sent as a noop
                    byte[] bytes = Version.full().getBytes();
                    ChannelBuffer writeBuffer = ChannelBuffers.dynamicBuffer(bytes.length);
                    writeBuffer.writeBytes(bytes);
                    channel.write(writeBuffer);
                    return MemcachedDispatcher.IGNORE_REQUEST;
                } else if ("quit".equals(cmd)) {
                    if (channel.isConnected()) { // we maybe in the process of clearing the queued bits
                        channel.disconnect();
View Full Code Here

Examples of org.gephi.project.spi.WorkspaceBytesPersistenceProvider.writeBytes()

            WorkspaceBytesPersistenceProvider provider = entry.getValue();

            //Write Project file
            zipOut.putNextEntry(new ZipEntry("Workspace_" + workspace.getId() + "_" + name + "_bytes"));

            provider.writeBytes(outputStream, workspace);

            //Close Project file
            zipOut.closeEntry();
        }
    }
View Full Code Here

Examples of org.gridgain.grid.spi.indexing.h2.opt.GridLuceneOutputStream.writeBytes()

            final int bytesInBuf = bufLength - bufPosition;
            final int toCp = (int)(bytesInBuf < left ? bytesInBuf : left);

            if (gridOut != null)
                gridOut.writeBytes(currBuf + bufPosition, toCp);
            else {
                byte[] buff = new byte[toCp];

                mem.readBytes(currBuf + bufPosition, buff);
View Full Code Here

Examples of org.h2.value.Transfer.writeBytes()

        trans.writeInt(Constants.TCP_PROTOCOL_VERSION_6);
        trans.writeInt(Constants.TCP_PROTOCOL_VERSION_9);
        trans.writeString(db);
        trans.writeString(ci.getOriginalURL());
        trans.writeString(ci.getUserName());
        trans.writeBytes(ci.getUserPasswordHash());
        trans.writeBytes(ci.getFilePasswordHash());
        String[] keys = ci.getKeys();
        trans.writeInt(keys.length);
        for (String key : keys) {
            trans.writeString(key).writeString(ci.getProperty(key));
View Full Code Here

Examples of org.hornetq.api.core.HornetQBuffer.writeBytes()

         {
            throw HornetQClientMessageBundle.BUNDLE.connectionExists(connection.getID());
         }
         String handshake = "HORNETQ";
         HornetQBuffer buffer = connection.createBuffer(handshake.length());
         buffer.writeBytes(handshake.getBytes());
         connection.write(buffer);
      }

      public void connectionDestroyed(final Object connectionID)
      {
View Full Code Here

Examples of org.hornetq.jms.client.HornetQStreamMessage.writeBytes()

   public void testReadBytesFromBytes() throws Exception
   {
      byte[] value = RandomUtil.randomBytes();
      HornetQStreamMessage message = new HornetQStreamMessage();

      message.writeBytes(value);
      message.reset();

      byte[] v = new byte[value.length];
      message.readBytes(v);
View Full Code Here

Examples of org.hornetq.jms.tests.message.SimpleJMSBytesMessage.writeBytes()

      SimpleJMSBytesMessage m = new SimpleJMSBytesMessage();

      log.debug("creating JMS Message type " + m.getClass().getName());

      String bytes = "HornetQ";
      m.writeBytes(bytes.getBytes());
      return m;
   }

   @Override
   protected void assertEquivalent(final Message m, final int mode, final boolean redelivery) throws JMSException
View Full Code Here

Examples of org.hornetq.jms.tests.message.SimpleJMSStreamMessage.writeBytes()

      SimpleJMSStreamMessage m = new SimpleJMSStreamMessage();

      log.debug("creating JMS Message type " + m.getClass().getName());

      m.writeBoolean(true);
      m.writeBytes("jboss".getBytes());
      m.writeChar('c');
      m.writeDouble(1.0D);
      m.writeFloat(2.0F);
      m.writeInt(3);
      m.writeLong(4L);
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.