Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

gnu.javax.net.ssl.provider
Class RecordingInputStream  view RecordingInputStream download RecordingInputStream.java

java.lang.Object
  extended byjava.io.InputStream
      extended byjava.io.FilterInputStream
          extended bygnu.javax.net.ssl.provider.RecordingInputStream
All Implemented Interfaces:
java.io.Closeable

class RecordingInputStream
extends java.io.FilterInputStream

A filter input stream that records every byte read from the underlying input stream. This class is useful for protocols that require portions of the communication to be saved, such as the handshake and key derivation in SSL.


Field Summary
protected  java.io.ByteArrayOutputStream sink
           
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
(package private) RecordingInputStream(java.io.InputStream in)
           
(package private) RecordingInputStream(java.io.InputStream in, java.io.ByteArrayOutputStream sink)
           
 
Method Summary
(package private)  byte[] getBytes()
          Returns all bytes recorded after this instance was created, or the last call to resetSink() 55 .
 int read()
          Calls the in.read() method
 int read(byte[] buf)
          Calls the read(byte[], int, int) overloaded method.
 int read(byte[] buf, int off, int len)
          Calls the in.read(byte[], int, int) method.
(package private)  void resetSink()
          Clears the recording buffer off all previously-recorded bytes.
 long skip(long len)
          Calls the in.skip(long) method
 
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sink

protected java.io.ByteArrayOutputStream sink
Constructor Detail

RecordingInputStream

RecordingInputStream(java.io.InputStream in)

RecordingInputStream

RecordingInputStream(java.io.InputStream in,
                     java.io.ByteArrayOutputStream sink)
Method Detail

read

public int read()
         throws java.io.IOException
Description copied from class: java.io.FilterInputStream
Calls the in.read() method


read

public int read(byte[] buf,
                int off,
                int len)
         throws java.io.IOException
Description copied from class: java.io.FilterInputStream
Calls the in.read(byte[], int, int) method.


read

public int read(byte[] buf)
         throws java.io.IOException
Description copied from class: java.io.FilterInputStream
Calls the read(byte[], int, int) overloaded method. Note that this method does not redirect its call directly to a corresponding method in in. This allows subclasses to override only the three argument version of read.


skip

public long skip(long len)
          throws java.io.IOException
Description copied from class: java.io.FilterInputStream
Calls the in.skip(long) method


getBytes

byte[] getBytes()
Returns all bytes recorded after this instance was created, or the last call to resetSink() 55 .


resetSink

void resetSink()
Clears the recording buffer off all previously-recorded bytes.