Class ByteOutputKineticStream

  • All Implemented Interfaces:
    OutputKineticStream, AutoCloseable

    public class ByteOutputKineticStream
    extends Object
    implements OutputKineticStream

    Kinetic stream implementation for serialization of Java objects into sequence of bytes.

    Any array 'A' serialized as follows:

    writeInt(A.length) | KineticStreamWriter::write(a[0]) | ... | KineticStreamWriter::write(a[N])

    Where write call for each item will use KineticStreamWriter on same kinetic stream object (ie. 'this').

    • Constructor Detail

      • ByteOutputKineticStream

        public ByteOutputKineticStream​(DataOutput out)
        Creates byte kinetic stream and attaches it to 'out'
    • Method Detail

      • writeString

        public void writeString​(String str)
                         throws IOException
        Specified by:
        writeString in interface OutputKineticStream
        Throws:
        IOException
      • writeInt

        public void writeInt​(Integer i)
                      throws IOException
        Specified by:
        writeInt in interface OutputKineticStream
        Throws:
        IOException
      • writeDouble

        public void writeDouble​(Double f)
                         throws IOException
        Specified by:
        writeDouble in interface OutputKineticStream
        Throws:
        IOException
      • writeFloat

        public void writeFloat​(Float f)
                        throws IOException
        Specified by:
        writeFloat in interface OutputKineticStream
        Throws:
        IOException
      • writeBoolean

        public void writeBoolean​(Boolean b)
                          throws IOException
        Specified by:
        writeBoolean in interface OutputKineticStream
        Throws:
        IOException
      • writeArray

        public void writeArray​(Object[] array)
                        throws Exception
        Specified by:
        writeArray in interface OutputKineticStream
        Throws:
        Exception
      • close

        public void close()
                   throws Exception
        Specified by:
        close in interface AutoCloseable
        Throws:
        Exception
      • writeByte

        public void writeByte​(Byte b)
                       throws Exception
        Specified by:
        writeByte in interface OutputKineticStream
        Throws:
        Exception