hudson.remoting
Class BinarySafeStream

java.lang.Object
  extended by hudson.remoting.BinarySafeStream

public final class BinarySafeStream
extends java.lang.Object

Tunnels byte stream into another byte stream so that binary data can be sent across binary-unsafe stream.

This implementation uses a variation of base64. A care has been taken to ensure that the following scenario is handled correctly.

  1. If the writing side flush, the reading side should see everything written by then, without blocking (even if this happens outside the 3-byte boundary)
  2. Reading side won't block unnecessarily.

Author:
Kohsuke Kawaguchi

Method Summary
static java.io.InputStream wrap(java.io.InputStream in)
          Decode binary safe stream.
static java.io.OutputStream wrap(java.io.OutputStream out)
          Wraps an OutputStream to encoding OutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

wrap

public static java.io.InputStream wrap(java.io.InputStream in)
Decode binary safe stream.


wrap

public static java.io.OutputStream wrap(java.io.OutputStream out)
Wraps an OutputStream to encoding OutputStream.

Parameters:
out - This output stream should be buffered for better performance.


Copyright © 2013. All Rights Reserved.