Class InMemoryRepository.Out

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

    private abstract static class InMemoryRepository.Out
    extends DfsOutputStream
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private byte[] data  
      private java.io.ByteArrayOutputStream dst  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Out()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      abstract void flush()  
      (package private) byte[] getData()  
      int read​(long position, java.nio.ByteBuffer buf)
      Read back a portion of already written data.
      void write​(byte[] buf, int off, int len)
      • Methods inherited from class java.io.OutputStream

        write
      • Methods inherited from class java.lang.Object

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

      • dst

        private final java.io.ByteArrayOutputStream dst
      • data

        private byte[] data
    • Constructor Detail

      • Out

        private Out()
    • Method Detail

      • read

        public int read​(long position,
                        java.nio.ByteBuffer buf)
        Description copied from class: DfsOutputStream
        Read back a portion of already written data.

        The writing position of the output stream is not affected by a read.

        Specified by:
        read in class DfsOutputStream
        Parameters:
        position - offset to read from.
        buf - buffer to populate. Up to buf.remaining() bytes will be read from position.
        Returns:
        number of bytes actually read.
      • getData

        byte[] getData()
      • flush

        public abstract 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.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.OutputStream