org.apache.hadoop.io
Class DataOutputOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by org.apache.hadoop.io.DataOutputOutputStream
All Implemented Interfaces:
Closeable, Flushable

@InterfaceAudience.Public
@InterfaceStability.Unstable
public class DataOutputOutputStream
extends OutputStream

OutputStream implementation that wraps a DataOutput.


Method Summary
static OutputStream constructOutputStream(DataOutput out)
          Construct an OutputStream from the given DataOutput.
 void write(byte[] b)
           
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 
Methods inherited from class java.io.OutputStream
close, flush
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

constructOutputStream

public static OutputStream constructOutputStream(DataOutput out)
Construct an OutputStream from the given DataOutput. If 'out' is already an OutputStream, simply returns it. Otherwise, wraps it in an OutputStream.

Parameters:
out - the DataOutput to wrap
Returns:
an OutputStream instance that outputs to 'out'

write

public void write(int b)
           throws IOException
Specified by:
write in class OutputStream
Throws:
IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
Overrides:
write in class OutputStream
Throws:
IOException

write

public void write(byte[] b)
           throws IOException
Overrides:
write in class OutputStream
Throws:
IOException


Copyright © 2013 Apache Software Foundation. All Rights Reserved.