Class FixedLengthOutputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable

    public class FixedLengthOutputStream
    extends java.io.OutputStream
    A stream that refuses to write more than a maximum number of bytes.
    • Constructor Summary

      Constructors 
      Constructor Description
      FixedLengthOutputStream​(int size, java.io.OutputStream target)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int remaining()  
      void write​(byte[] buf, int offset, int len)  
      void write​(int b)  
      • Methods inherited from class java.io.OutputStream

        close, flush, nullOutputStream, write
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FixedLengthOutputStream

        public FixedLengthOutputStream​(int size,
                                       java.io.OutputStream target)
    • Method Detail

      • write

        public void write​(int b)
                   throws java.io.IOException
        Specified by:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • write

        public void write​(byte[] buf,
                          int offset,
                          int len)
                   throws java.io.IOException
        Overrides:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • remaining

        public int remaining()