java/proto/src/main/java/com/pravala/protocol/Serializable.java
public boolean deserializeData ( ReadBuffer readBuffer ) throws CodecException
    {
        if ( readBuffer == null || readBuffer.getOffset() < 0
             || readBuffer.getSize() < 1 || readBuffer.getOffset() > readBuffer.getSize() )
        {
            throw new CodecException ( ErrorCode.InvalidParameter );
        }

        clear();

        boolean ret = true;

        int offset = readBuffer.getOffset();

        while ( offset < readBuffer.getSize() )
        {
            ReadBuffer tmpBuf = new ReadBuffer ( readBuffer.getBuffer(), offset, readBuffer.getSize() );

            Codec.FieldHeader hdr = Codec.readFieldHeader ( tmpBuf );

            // The new offset (it doesn't affect or depend on the deserializeField!):
            offset = tmpBuf.getOffset() + hdr.fieldSize;

            if ( offset > tmpBuf.getSize() )
            {
                throw new CodecException ( ErrorCode.IncompleteData );
            }

            tmpBuf.setSize ( offset );

            if ( !deserializeField ( hdr, tmpBuf ) )
            {
                ret = false;
            }
        }

        // Regardless of the 'ret' value we want to check if everything is OK
        validate();

        return ret;
    }
/**
     * Deserializes data from the buffer
     *
     * First the deserialize() from inherited object is called.
     * Next, all present, local fields are deserialized -
     * either by deserializing them directly, or by calling their deserialize()
     * @param readBuffer The buffer to deserialize the data from. Its offset is NOT modified.
     * @return True if the message has been successfully deserialized,
     *         False if an unknown field was found, and throws an exception on errors
     * @throws CodecException
     */
Deserializes data from the buffer
First the deserialize() from inherited object is called.
Next, all present, local fields are deserialized
either by deserializing them directly, or by calling their deserialize()
@param readBuffer The buffer to deserialize the data from. Its offset is NOT modified.
@return True if the message has been successfully deserialized,
False if an unknown field was found, and throws an exception on errors
@throws CodecException
Deserializes data from the buffer First the deserialize () from inherited object is called . Next all present local fields are deserialized either by deserializing them directly or by calling their deserialize () @param readBuffer The buffer to deserialize the data from . Its offset is NOT modified . @return True if the message has been successfully deserialized False if an unknown field was found and throws an exception on errors @throws CodecException
public boolean deserializeData ( ReadBuffer readBuffer ) throws CodecException
    {
        if ( readBuffer == null || readBuffer.getOffset() < 0
             || readBuffer.getSize() < 1 || readBuffer.getOffset() > readBuffer.getSize() )
        {
            throw new CodecException ( ErrorCode.InvalidParameter );
        }
        clear();
        boolean ret = true;
        int offset = readBuffer.getOffset();
        while ( offset < readBuffer.getSize() )
        {
            ReadBuffer tmpBuf = new ReadBuffer ( readBuffer.getBuffer(), offset, readBuffer.getSize() );
            Codec.FieldHeader hdr = Codec.readFieldHeader ( tmpBuf );
            offset = tmpBuf.getOffset() + hdr.fieldSize;
            if ( offset > tmpBuf.getSize() )
            {
                throw new CodecException ( ErrorCode.IncompleteData );
            }
            tmpBuf.setSize ( offset );
            if ( !deserializeField ( hdr, tmpBuf ) )
            {
                ret = false;
            }
        }
        validate();
        return ret;
    }
public boolean deserializeData ( ReadBuffer readBuffer ) throws CodecException { if ( readBuffer == null || readBuffer . getOffset ( ) < 0 || readBuffer . getSize ( ) < 1 || readBuffer . getOffset ( ) > readBuffer . getSize ( ) ) { throw new CodecException ( ErrorCode . InvalidParameter ) ; } clear ( ) ; boolean ret = true ; int offset = readBuffer . getOffset ( ) ; while ( offset < readBuffer . getSize ( ) ) { ReadBuffer tmpBuf = new ReadBuffer ( readBuffer . getBuffer ( ) , offset , readBuffer . getSize ( ) ) ; Codec . FieldHeader hdr = Codec . readFieldHeader ( tmpBuf ) ; offset = tmpBuf . getOffset ( ) + hdr . fieldSize ; if ( offset > tmpBuf . getSize ( ) ) { throw new CodecException ( ErrorCode . IncompleteData ) ; } tmpBuf . setSize ( offset ) ; if ( ! deserializeField ( hdr , tmpBuf ) ) { ret = false ; } } validate ( ) ; return ret ; }
Deserializes data from the buffer
 First the deserialize() from inherited object is called.
Deserializes data from the buffer First the deserialize () from inherited object is called .
// The new offset (it doesn't affect or depend on the deserializeField!): // Regardless of the 'ret' value we want to check if everything is OK