Examples of wrapAsByteBuffer()


Examples of org.apache.flink.runtime.io.network.serialization.DataOutputSerializer.wrapAsByteBuffer()

      // Write out the ConnectionHeader
      DataOutputSerializer buf = new DataOutputSerializer(4 + header.getProtocol().getBytes().length + 1);
      header.write(buf);

      // Write out the payload length
      ByteBuffer wrapper = buf.wrapAsByteBuffer();
      int bufLen = wrapper.limit();
      out.writeInt(bufLen);
      out.write(wrapper.array(), 0, bufLen);
    }
View Full Code Here

Examples of org.apache.flink.runtime.io.network.serialization.DataOutputSerializer.wrapAsByteBuffer()

          // First, write call id to buffer d
          d.writeInt(call.id);
          // Then write RPC data (the actual call) to buffer d
          call.param.write(d);

          ByteBuffer wrapper = d.wrapAsByteBuffer();
          byte[] data = wrapper.array();
          int dataLength = wrapper.limit();
          out.writeInt(dataLength); // first put the data length
          out.write(data, 0, dataLength);// write the data
          out.flush();
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.