Same as {@link #sendWithBinaryData(ProducerConnectionContext, BasicMessage, InputStream, Map)} with
<code>null</code> headers.
329433
public MessageId sendWithBinaryData(ProducerConnectionContext context, BasicMessage basicMessage,
            InputStream inputStream) throws JMSException {
        return sendWithBinaryData(context, basicMessage, inputStream, null);
    }
322374
public void sendData() throws IOException {
        if (writer != null) {
            writer.write(buffer.toString());
            writer.flush();
            buffer = new StringBuilder();
        }
    }
869116
public void send(String uri, String data) {
        Objects.requireNonNull(uri, Required.URI.toString());

        final Set<ServerSentEventConnection> uriConnections = getConnections(uri);
        if (uriConnections != null) {
            uriConnections.stream()
                .filter(ServerSentEventConnection::isOpen)
                .forEach((ServerSentEventConnection connection) -> connection.send(data));
            
       }
    }
40071
public synchronized boolean sendData(byte[] bytes) {
		if (bytes != null && bytes.length > 0 && !closed.get()) {
			try {
				if (listeners == null) {
					buffer.addLast(bytes);
				} else if (listeners.length == 1) {
					listeners[0].onPacket(bytes, null, false);
				} else {
					for (PacketListener listener : listeners) {
						listener.onPacket(bytes, null, false);
					}
				}
				transferedBytes.addAndGet(bytes.length);
			} catch (MoleculerError moleculerError) {
				throw moleculerError;
			} catch (Throwable error) {
				throw new MoleculerClientError("Unable to send bytes to stream listener!", error, nodeID, null);
			}
			return true;
		}
		return false;
	}
1021785
public void fromBytes(byte[] data) {
        if (data == null || data.length != 4) {
            throw new IllegalArgumentException("invalid header data. It can't be null and the length must be 4 byte.");
        }
        this.packetBodyLength = (data[0] & 0xFF) | ((data[1] & 0xFF) << 8) | ((data[2] & 0xFF) << 16);
        this.setPacketSequenceNumber(data[3]);
    }
499282
public RequestResponse setResponseData(byte[] responseData) {
        this.responseData = responseData;
        try {
            responseJson = responseData != null ? SerializationUtils.readJson(responseData) : null;
        } catch (Exception e) {
            responseJson = null;
            LOGGER.error(e.getMessage(), e);
        }
        return this;
    }
619598
public static void sendBinaryBlocking(final ByteBuffer data, final WebSocketChannel wsChannel) throws IOException {
        sendBlockingInternal(data, WebSocketFrameType.BINARY, wsChannel);
    }
393859
public static <T> T fromByteArrayKryo(byte[] data, Class<T> clazz) {
        return fromByteArrayKryo(data, clazz, null);
    }
1361512
public ByteBufHttpData writePayload(ByteBuf message) {
        verifyNotClosed();
        final boolean compressed = messageCompression && compressor != null;
        final int messageLength = message.readableBytes();
        try {
            final ByteBuf buf;
            if (messageLength != 0 && compressed) {
                buf = writeCompressed(message);
            } else {
                buf = writeUncompressed(message);
            }
            return new ByteBufHttpData(buf, false);
        } catch (IOException | RuntimeException e) {
            // IOException will not be thrown, since sink#deliverFrame doesn't throw.
            throw new ArmeriaStatusException(
                    StatusCodes.INTERNAL,
                    "Failed to frame message",
                    e);
        }
    }
983139
public void send(String data) throws UnsupportedEncodingException {
        log.trace("send message: {}", data);
        // process the incoming string
        if (StringUtils.isNotBlank(data)) {
            send(Packet.build(data.getBytes("UTF8"), MessageType.TEXT));
        } else {
            throw new UnsupportedEncodingException("Cannot send a null string");
        }
    }
773278
public String sendDataWithObjectMapper(Object sourceObject, String index,
            String type) {
        return sendDataWithObjectMapper(sourceObject, index, type, null)
                .getId();
    }
433580
private ByteBufferSerializer<?>[] writeHeader(BundleStreamSource source, ByteBuffer buffer, WritableByteChannel output) throws IOException {
    final BundleMeta meta = source.getMeta();
    final int nummeta = meta.size();
    @SuppressWarnings("rawtypes")
    final ByteBufferSerializer[] serializers = new ByteBufferSerializer[1 + nummeta];
    // Write our magic ID first.
    assert (buffer.position() == 0) : "Buffer is supposed to be at 0.";
    buffer.putInt(MAGIC);
    // Write the number of metas next.
    // For compatibility with earlier versions, treat DBIDs as extra type
    if(source.hasDBIDs()) {
      buffer.putInt(1 + nummeta);
      ByteBufferSerializer<DBID> ser = DBIDFactory.FACTORY.getDBIDSerializer();
      TypeInformationSerializer.STATIC.toByteBuffer(buffer, new SimpleTypeInformation<>(DBID.class, ser));
      serializers[0] = ser;
    }
    else {
      buffer.putInt(nummeta);
    }
    for(int i = 0; i < nummeta; i++) {
      SimpleTypeInformation<?> type = meta.get(i);
      ByteBufferSerializer<?> ser = type.getSerializer();
      if(ser == null) {
        throw new AbortException("Cannot serialize - no serializer found for type: " + type.toString());
      }
      TypeInformationSerializer.STATIC.toByteBuffer(buffer, type);
      serializers[i + 1] = ser;
    }
    return serializers;
  }
1270503
private <M extends MessageHeaders<EmptyRequestBody, P, U>, U extends MessageParameters, P extends ResponseBody> CompletableFuture<P>
			sendRequest(M messageHeaders, U messageParameters) {
		return sendRequest(messageHeaders, messageParameters, EmptyRequestBody.getInstance());
	}
147869
@Override
    public void writeBytes(byte[] value) throws JMSException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "writeBytes", value);

        try {
            // Check that we are in write mode
            checkBodyWriteable("writeBytes");

            // This method has different behaviours for storing the byte array, based on the whether the producer
            // has promised not to mess with data after it's been written...
            if (producerWontModifyPayloadAfterSet) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    SibTr.debug(this, tc, "Producer has promised not to modify the payload after setting it in the message - check if they've violated that promise");

                // The producer has promised not to modify the payload after it's been set, so check
                // the flag to see whether this is the first, or a subsequent call to writeBytes.
                if (!writeByteArrayCalled) {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                        SibTr.debug(this, tc, "This is the first call to writeBytes(byte[] value) - storing the byte array reference directly in the underlying MFP object");

                    writeByteArrayCalled = true;

                    // Set the data buffer & MFP data references to the value param & reset
                    // the dataStart attribute
                    jsBytesMsg.setBytes(value);
                    dataBuffer = value;
                    dataStart = 0;
                }

                else {
                    // The producer has promised not to modify the payload after it's been set, but the producer has
                    // been naughty by calling this method more than once! Throw exception to admonish the producer.
                    throw (JMSException) JmsErrorUtils.newThrowable(
                                                                    IllegalStateException.class, // JMS illegal state exception
                                                                    "PROMISE_BROKEN_EXCEPTION_CWSIA0511", // promise broken
                                                                    null, // No inserts
                                                                    null, // no cause - original exception
                                                                    "JmsBytesMessageImpl.writeBytes#3", // Probe ID
                                                                    this, // Caller (?)
                                                                    tc); // Trace component
                }
            }

            else {
                // Producer makes no promises relating to the accessing the message payload, so
                // make a copy of the byte array at this point to ensure the message is transmitted safely.
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    SibTr.debug(this, tc, "Producer 'payload modification' promise is not in place - make a copy of the byte array");

                // Write the byte array to the output stream
                // We don't check for value==null as JDK1.1.6 DataOutputStream doesn't
                writeStream.write(value, 0, value.length);

                // Ensure that the new data gets exported when the time comes.
                bodySetInJsMsg = false;
            }

            // Invalidate the cached toString object, because the message payload has changed.
            cachedBytesToString = null;
        }

        catch (IOException ex) {
            // No FFDC code needed
            //(exception repro'ed from 3-param writeBytes method)
            throw (JMSException) JmsErrorUtils.newThrowable(
                                                            ResourceAllocationException.class,
                                                            "WRITE_PROBLEM_CWSIA0186",
                                                            null,
                                                            ex,
                                                            "JmsBytesMessageImpl.writeBytes#4",
                                                            this,
                                                            tc);
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "writeBytes");
    }
93703
public void writeBinary(final PacketOutputStream pos) throws IOException {
    pos.writeFieldLength(defaultBytes.length);
    pos.write(defaultBytes);
  }
288933
@Override
    public void sendResponse(StoreStats performanceStats,
                             boolean isFromLocalZone,
                             long startTimeInMs) throws Exception {

        ChannelBuffer responseContent = ChannelBuffers.dynamicBuffer(this.responseValue.length);
        responseContent.writeBytes(responseValue);

        // 1. Create the Response object
        HttpResponse response = new DefaultHttpResponse(HTTP_1_1, OK);

        // 2. Set the right headers
        response.setHeader(CONTENT_TYPE, "binary");
        response.setHeader(CONTENT_TRANSFER_ENCODING, "binary");

        // 3. Copy the data into the payload
        response.setContent(responseContent);
        response.setHeader(CONTENT_LENGTH, response.getContent().readableBytes());

        if(logger.isDebugEnabled()) {
            logger.debug("Response = " + response);
        }

        // Write the response to the Netty Channel
        this.messageEvent.getChannel().write(response);

        if(performanceStats != null && isFromLocalZone) {
            recordStats(performanceStats, startTimeInMs, Tracked.GET);
        }
    }
720935
public static void sendPostData(HttpURLConnection conn, String encodedData) throws IOException {

        StreamManager sm = new StreamManager();

        try {

            conn.setDoOutput(true);
            conn.setRequestMethod("POST");
            if (conn.getRequestProperty("Content-Type") == null) {
                conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            }
            if (encodedData != null) {
                if (conn.getRequestProperty("Content-Length") == null) {
                    conn.setRequestProperty("Content-Length", String.valueOf(encodedData.getBytes("UTF-8").length));
                }
                DataOutputStream out = new DataOutputStream(sm.handle(conn.getOutputStream()));
                out.write(encodedData.getBytes());
                out.close();
            }
        } finally {
            sm.closeAll();
        }
    }