Interface BinaryWriterEx

    • Method Detail

      • reserveInt

        int reserveInt()
        Reserve a room for an integer.
        Returns:
        Position in the stream where value is to be written.
      • failIfUnregistered

        boolean failIfUnregistered()
        Returns:
        Fail if unregistered flag value.
      • array

        byte[] array()
        Returns:
        Array.
      • preWrite

        void preWrite​(@Nullable
                      @Nullable String clsName)
        Perform pre-write. Reserves space for header and writes class name if needed.
        Parameters:
        clsName - Class name (optional).
      • postWrite

        void postWrite​(boolean userType,
                       boolean registered)
        Perform post-write. Fills object header.
        Parameters:
        userType - User type flag.
        registered - Whether type is registered.
      • postWriteHashCode

        void postWriteHashCode​(@Nullable
                               @Nullable String clsName)
        Perform post-write hash code update if necessary.
        Parameters:
        clsName - Class name. Always null if class is registered.
      • popSchema

        void popSchema()
        Pop schema.
      • writeFieldId

        void writeFieldId​(int fieldId)
        Write field ID.
        Parameters:
        fieldId - Field ID.
      • newWriter

        BinaryWriterEx newWriter​(int typeId)
        Create new writer with same context.
        Parameters:
        typeId - type
        Returns:
        New writer.
      • write

        void write​(byte[] b,
                   int off,
                   int len)
        Writes a sub array of bytes.
        Specified by:
        write in interface DataOutput
        Specified by:
        write in interface ObjectOutput
        Parameters:
        b - the data to be written
        off - the start offset in the data
        len - the number of bytes that are written
      • schemaId

        int schemaId()
        Returns:
        Schema ID.
      • schemaId

        void schemaId​(int schemaId)
        Parameters:
        schemaId - Schema ID.
      • writeBooleanFieldPrimitive

        void writeBooleanFieldPrimitive​(boolean val)
        Parameters:
        val - Value.
      • writeByteFieldPrimitive

        void writeByteFieldPrimitive​(byte val)
        Parameters:
        val - Value.
      • writeCharFieldPrimitive

        void writeCharFieldPrimitive​(char val)
        Parameters:
        val - Value.
      • writeShortFieldPrimitive

        void writeShortFieldPrimitive​(short val)
        Parameters:
        val - Value.
      • writeIntFieldPrimitive

        void writeIntFieldPrimitive​(int val)
        Parameters:
        val - Value.
      • writeLongFieldPrimitive

        void writeLongFieldPrimitive​(long val)
        Parameters:
        val - Value.
      • writeFloatFieldPrimitive

        void writeFloatFieldPrimitive​(float val)
        Parameters:
        val - Value.
      • writeDoubleFieldPrimitive

        void writeDoubleFieldPrimitive​(double val)
        Parameters:
        val - Value.
      • writeByteArray

        int writeByteArray​(InputStream in,
                           int limit)
                    throws BinaryObjectException
        Write byte array from the InputStream.

        If limit > 0 than no more than limit bytes will be read and written. If limit == -1 than it will try to read and write all bytes.

        In any case if actual number of bytes is greater than MAX_ARRAY_SIZE than exception will be thrown.

        Parameters:
        in - InputStream.
        limit - Max length of data to be read from the stream or -1 if all data should be read.
        Returns:
        Number of bytes written.
        Throws:
        BinaryObjectException - If an I/O error occurs or stream contains more than MAX_ARRAY_SIZE bytes.
      • currentSchema

        BinarySchema currentSchema()
        Returns:
        Current writer's schema.
      • tryWriteAsHandle

        boolean tryWriteAsHandle​(Object obj)
        Attempts to write the object as a handle.
        Parameters:
        obj - Object to write.
        Returns:
        true if the object has been written as a handle.
      • writeBinaryArray

        void writeBinaryArray​(org.apache.ignite.internal.binary.BinaryArray val)
        Parameters:
        val - Array wrapper.
        Throws:
        BinaryObjectException - In case of error.
      • doWriteEnumArray

        void doWriteEnumArray​(Object[] val)
        Parameters:
        val - Array.
      • writeBinaryEnum

        void writeBinaryEnum​(BinaryObjectEx val)
        Parameters:
        val - Value.
      • writeClass

        void writeClass​(Class val)
        Parameters:
        val - Class.
      • writeProxy

        void writeProxy​(Proxy proxy,
                        Class<?>[] intfs)
        Parameters:
        proxy - Proxy.