Class BinOutput<T>

  • All Implemented Interfaces:
    Output<T>, java.io.Closeable, java.lang.AutoCloseable
    Direct Known Subclasses:
    BinFileOutput

    public abstract class BinOutput<T>
    extends java.lang.Object
    implements Output<T>
    The item output implementation serializing something into the specified stream
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.io.ObjectOutputStream output  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected BinOutput​(java.io.ObjectOutputStream output)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      int put​(java.util.List<T> items)  
      int put​(java.util.List<T> buffer, int from, int to)
      Bulk put method for the items from the specified buffer
      boolean put​(T item)
      Write the data item
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface com.github.akurilov.commons.io.Output

        getInput
    • Field Detail

      • output

        protected final java.io.ObjectOutputStream output
    • Constructor Detail

      • BinOutput

        protected BinOutput​(java.io.ObjectOutputStream output)
    • Method Detail

      • put

        public boolean put​(T item)
                    throws java.io.IOException
        Description copied from interface: Output
        Write the data item
        Specified by:
        put in interface Output<T>
        Parameters:
        item - the item to put
        Throws:
        java.io.IOException - if fails some-why
      • put

        public int put​(java.util.List<T> buffer,
                       int from,
                       int to)
                throws java.io.IOException
        Description copied from interface: Output
        Bulk put method for the items from the specified buffer
        Specified by:
        put in interface Output<T>
        Parameters:
        buffer - the buffer containing the items to put
        Returns:
        the count of the items successfully written
        Throws:
        java.io.IOException
      • put

        public final int put​(java.util.List<T> items)
                      throws java.io.IOException
        Specified by:
        put in interface Output<T>
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object