org.apache.spark.io
Class SnappyOutputStreamWrapper

Object
  extended by java.io.OutputStream
      extended by org.apache.spark.io.SnappyOutputStreamWrapper
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public final class SnappyOutputStreamWrapper
extends java.io.OutputStream

Wrapper over SnappyOutputStream which guards against write-after-close and double-close issues. See SPARK-7660 for more details. This wrapping can be removed if we upgrade to a version of snappy-java that contains the fix for https://github.com/xerial/snappy-java/issues/107.


Constructor Summary
SnappyOutputStreamWrapper(org.xerial.snappy.SnappyOutputStream os)
           
 
Method Summary
 void close()
           
 void flush()
           
 void write(byte[] b)
           
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SnappyOutputStreamWrapper

public SnappyOutputStreamWrapper(org.xerial.snappy.SnappyOutputStream os)
Method Detail

write

public void write(int b)
Specified by:
write in class java.io.OutputStream

write

public void write(byte[] b)
Overrides:
write in class java.io.OutputStream

write

public void write(byte[] b,
                  int off,
                  int len)
Overrides:
write in class java.io.OutputStream

flush

public void flush()
Specified by:
flush in interface java.io.Flushable
Overrides:
flush in class java.io.OutputStream

close

public void close()
Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.OutputStream