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

Quick Search    Search Deep

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

java.lang.Object
  extended byjava.io.OutputStream
      extended byjava.io.FilterOutputStream
          extended bygnu.javax.net.ssl.provider.RecordOutputStream

class RecordOutputStream
extends java.io.FilterOutputStream

An output stream for writing data to the record layer. All data written to this stream (through any of the write methods) is immediately sent as a full record, so it is advisable to write large arrays to the stream instead of one byte at a time (alternatively, a java.io.BufferedOutputStream can be used).


Field Summary
private static boolean DEBUG_RECORD_LAYER
           
private  boolean emitEmpty
           
private static java.util.logging.Logger logger
           
private  SecurityParameters params
          The security parameters.
private  ContentType type
          The content type of this output stream.
private static byte[] ZERO
           
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
(package private) RecordOutputStream(java.io.OutputStream out, ContentType type, SecurityParameters params)
           
 
Method Summary
 void write(byte[] buf)
          This method writes all the bytes in the specified array to the underlying OutputStream.
 void write(byte[] buf, int off, int len)
          This method calls the write(int) method len times for all bytes from the array buf starting at index offset.
 void write(int b)
          This method writes a single byte of output to the underlying OutputStream.
 
Methods inherited from class java.io.FilterOutputStream
close, flush
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG_RECORD_LAYER

private static final boolean DEBUG_RECORD_LAYER
See Also:
Constant Field Values

logger

private static final java.util.logging.Logger logger

type

private final ContentType type
The content type of this output stream.


params

private final SecurityParameters params
The security parameters.


emitEmpty

private final boolean emitEmpty

ZERO

private static final byte[] ZERO
Constructor Detail

RecordOutputStream

RecordOutputStream(java.io.OutputStream out,
                   ContentType type,
                   SecurityParameters params)
Method Detail

write

public void write(int b)
           throws java.io.IOException
Description copied from class: java.io.FilterOutputStream
This method writes a single byte of output to the underlying OutputStream.


write

public void write(byte[] buf)
           throws java.io.IOException
Description copied from class: java.io.FilterOutputStream
This method writes all the bytes in the specified array to the underlying OutputStream. It does this by calling the three parameter version of this method - write(byte[], int, int) in this class instead of writing to the underlying OutputStream directly. This allows most subclasses to avoid overriding this method.


write

public void write(byte[] buf,
                  int off,
                  int len)
           throws java.io.IOException
Description copied from class: java.io.FilterOutputStream
This method calls the write(int) method len times for all bytes from the array buf starting at index offset. Subclasses should overwrite this method to get a more efficient implementation.