Examples of writeByte()


Examples of org.apache.thrift.protocol.TTupleProtocol.writeByte()

        {
          oprot.writeI32(struct.badTServers.size());
          for (Map.Entry<String, Byte> _iter42 : struct.badTServers.entrySet())
          {
            oprot.writeString(_iter42.getKey());
            oprot.writeByte(_iter42.getValue());
          }
        }
      }
      if (struct.isSetState()) {
        oprot.writeI32(struct.state.getValue());
View Full Code Here

Examples of org.chromium.sdk.internal.websocket.ManualLoggingSocketWrapper.LoggableOutput.writeByte()

        throw new IOException("WebSocket is already closed for output");
      }

      byte firstByte = (byte) (FrameBits.FIN_BIT | OpCode.TEXT);

      output.writeByte(firstByte);

      int maskFlag = maskBytes == null ? 0 : FrameBits.MASK_BIT;

      if (length <= 125) {
        output.writeByte((byte) (length | maskFlag));
View Full Code Here

Examples of org.codehaus.activemq.message.ActiveMQBytesMessage.writeByte()

    }
  }
  public void testReadByte() {
    ActiveMQBytesMessage msg = new ActiveMQBytesMessage();
    try {
      msg.writeByte((byte) 2);
      msg.reset();
      assertTrue(msg.readByte() == 2);
    } catch (JMSException jmsEx) {
      jmsEx.printStackTrace();
      assertTrue(false);
View Full Code Here

Examples of org.codehaus.activemq.message.ActiveMQStreamMessage.writeByte()

  public void testReadObject()
  {
    ActiveMQStreamMessage msg = new ActiveMQStreamMessage();
    try {
      byte testByte = (byte)2;
      msg.writeByte(testByte);
      msg.reset();
      assertTrue(((Byte)msg.readObject()).byteValue()==testByte);
      msg.clearBody();
     
      short testShort = 3;
View Full Code Here

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

public class BytesStreamsTests {

    @Test public void testSimpleStreams() throws Exception {
        BytesStreamOutput out = CachedStreamOutput.popEntry().cachedBytes();
        out.writeBoolean(false);
        out.writeByte((byte) 1);
        out.writeShort((short) -1);
        out.writeInt(-1);
        out.writeVInt(2);
        out.writeLong(-3);
        out.writeVLong(4);
View Full Code Here

Examples of org.elasticsearch.common.io.stream.HandlesStreamOutput.writeByte()

        try {
            HandlesStreamOutput stream = cachedEntry.cachedHandlesBytes();
            stream.writeLong(requestId);
            byte status = 0;
            status = TransportStreams.statusSetResponse(status);
            stream.writeByte(status); // 0 for request, 1 for response.
            message.writeTo(stream);
            final byte[] data = cachedEntry.bytes().copiedByteArray();
            targetTransport.threadPool().cached().execute(new Runnable() {
                @Override public void run() {
                    targetTransport.messageReceived(data, action, sourceTransport, null);
View Full Code Here

Examples of org.elasticsearch.common.io.stream.ReleasableBytesStreamOutput.writeByte()

    private BytesReference getRandomizedPagedBytesReference(int length) {
        // we know bytes stream output always creates a paged bytes reference, we use it to create randomized content
        ReleasableBytesStreamOutput out = new ReleasableBytesStreamOutput(length, bigarrays);
        try {
            for (int i = 0; i < length; i++) {
                out.writeByte((byte) getRandom().nextInt(1 << 8));
            }
        } catch (IOException e) {
            fail("should not happen " + e.getMessage());
        }
        assertThat(out.size(), Matchers.equalTo(length));
View Full Code Here

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

        StreamOutput stream = new HandlesStreamOutput(bStream);
        stream.setVersion(version);
        stream.writeLong(requestId);
        byte status = 0;
        status = TransportStatus.setResponse(status);
        stream.writeByte(status); // 0 for request, 1 for response.
        response.writeTo(stream);
        stream.close();
        final byte[] data = bStream.bytes().toBytes();
        targetTransport.workers().execute(new Runnable() {
            @Override
View Full Code Here

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

        int CYCLE_SIZE = 50000;
        final long NUMBER_OF_ITERATIONS = 500000;

        ChannelBuffer message = ChannelBuffers.buffer(100);
        for (int i = 0; i < message.capacity(); i++) {
            message.writeByte((byte) i);
        }

        // Configure the server.
        ServerBootstrap serverBootstrap = new ServerBootstrap(
                new NioServerSocketChannelFactory(
View Full Code Here

Examples of org.exist.storage.io.VariableByteOutputStream.writeByte()

        final Capture<Byte> byteCapture = new Capture<Byte>();
        final Capture<Integer> intCapture = new Capture<Integer>();
        final Capture<String> strCapture = new Capture<String>();

        //write expectations
        mockOs.writeByte(captureByte(byteCapture));
        mockOs.writeInt(captureInt(intCapture));
        mockOs.writeUTF(capture(strCapture));

        replay(mockOs);
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.