Class RangedOutputStream.Range

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

    public class RangedOutputStream.Range
    extends java.io.OutputStream
    A ranged OutputStream.
    • Constructor Summary

      Constructors 
      Constructor Description
      Range​(long from, long to)
      Instantiates a new range.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean contains​(long index)
      Contains.
      byte[] getBytes()
      Returns the bytes of this range.
      long getFrom()
      Returns the starting index of this range.
      java.lang.Long getTo​(long ifZero)
      Returns the ending index of this range.
      void write​(int b)  
      • Methods inherited from class java.io.OutputStream

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

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

      • Range

        public Range​(long from,
                     long to)
        Instantiates a new range.
        Parameters:
        from - the starting byte index
        to - the ending byte index
    • Method Detail

      • contains

        public boolean contains​(long index)
        Contains.
        Parameters:
        index - the index to check
        Returns:
        true, if the index is in this range
      • getBytes

        public byte[] getBytes()
        Returns the bytes of this range.
        Returns:
        the bytes of this range
      • getFrom

        public long getFrom()
        Returns the starting index of this range.
        Returns:
        the starting index of this range
      • getTo

        public java.lang.Long getTo​(long ifZero)
        Returns the ending index of this range.
        Parameters:
        ifZero - the index to return if the range end is not bound
        Returns:
        the ending index of this range
      • write

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