public void sendStdin(final InputStream msg) throws IOException { assert holdsLock(lock); // Call under lock try { // WFLY-2697 All writing is in Base64 Base64OutputStream base64 = getBase64OutputStream(stdin); StreamUtils.copyStream(msg, base64); base64.close(); // not flush(). close() writes extra data to the stream allowing Base64 input stream // to distinguish end of message } catch (IOException e) { log.failedToSendDataBytes(e, processName); throw e; } }
public void sendStdin(final InputStream msg) throws IOException { assert holdsLock(lock); // Call under lock try { // WFLY-2697 All writing is in Base64 Base64OutputStream base64 = getBase64OutputStream(stdin); StreamUtils.copyStream(msg, base64); base64.close(); // not flush(). close() writes extra data to the stream allowing Base64 input stream // to distinguish end of message } catch (IOException e) { log.failedToSendDataBytes(e, processName); throw e; } }
try { OutputStream base64 = getBase64OutputStream(stdin); base64.write(authKey.getBytes(Charset.forName("US-ASCII")));
try { OutputStream base64 = getBase64OutputStream(stdin); base64.write(authKey.getBytes(Charset.forName("US-ASCII")));
public void reconnect(String scheme, String hostName, int port, boolean managementSubsystemEndpoint, String asAuthKey) { assert holdsLock(lock); // Call under lock try { // WFLY-2697 All writing is in Base64 Base64OutputStream base64 = getBase64OutputStream(stdin); StreamUtils.writeUTFZBytes(base64, scheme); StreamUtils.writeUTFZBytes(base64, hostName); StreamUtils.writeInt(base64, port); StreamUtils.writeBoolean(base64, managementSubsystemEndpoint); base64.write(asAuthKey.getBytes(Charset.forName("US-ASCII"))); base64.close(); // not flush(). close() writes extra data to the stream allowing Base64 input stream // to distinguish end of message } catch (IOException e) { if(state == State.STARTED) { // Only log in case the process is still running log.failedToSendReconnect(e, processName); } } }
public void reconnect(String scheme, String hostName, int port, boolean managementSubsystemEndpoint, String asAuthKey) { assert holdsLock(lock); // Call under lock try { // WFLY-2697 All writing is in Base64 Base64OutputStream base64 = getBase64OutputStream(stdin); StreamUtils.writeUTFZBytes(base64, scheme); StreamUtils.writeUTFZBytes(base64, hostName); StreamUtils.writeInt(base64, port); StreamUtils.writeBoolean(base64, managementSubsystemEndpoint); base64.write(asAuthKey.getBytes(Charset.forName("US-ASCII"))); base64.close(); // not flush(). close() writes extra data to the stream allowing Base64 input stream // to distinguish end of message } catch (IOException e) { if(state == State.STARTED) { // Only log in case the process is still running log.failedToSendReconnect(e, processName); } } }