Package com.alibaba.otter.canal.parse.driver.mysql.utils

Examples of com.alibaba.otter.canal.parse.driver.mysql.utils.LengthCodedStringReader


    private List<String> columns = new ArrayList<String>();

    public void fromBytes(byte[] data) throws IOException {
        int index = 0;
        LengthCodedStringReader reader = new LengthCodedStringReader(null, index);
        do {
            getColumns().add(reader.readLengthCodedString(data));
        } while (reader.getIndex() < data.length);
    }
View Full Code Here


     * </pre>
     */
    public void fromBytes(byte[] data) throws IOException {

        int index = 0;
        LengthCodedStringReader reader = new LengthCodedStringReader(null, index);
        // 1.
        catalog = reader.readLengthCodedString(data);
        // 2.
        db = reader.readLengthCodedString(data);
        this.table = reader.readLengthCodedString(data);
        this.originalTable = reader.readLengthCodedString(data);
        this.name = reader.readLengthCodedString(data);
        this.originalName = reader.readLengthCodedString(data);
        index = reader.getIndex();
        //
        index++;
        //
        this.character = ByteHelper.readUnsignedShortLittleEndian(data, index);
        index += 2;
        //
        this.length = ByteHelper.readUnsignedIntLittleEndian(data, index);
        index += 4;
        //
        this.type = data[index];
        index++;
        //
        this.flags = ByteHelper.readUnsignedShortLittleEndian(data, index);
        index += 2;
        //
        this.decimals = data[index];
        index++;
        //
        if (index < data.length) {
            reader.setIndex(index);
            this.definition = reader.readLengthCodedString(data);
        }
    }
View Full Code Here

     * </pre>
     */
    public void fromBytes(byte[] data) throws IOException {

        int index = 0;
        LengthCodedStringReader reader = new LengthCodedStringReader(null, index);
        // 1.
        catalog = reader.readLengthCodedString(data);
        // 2.
        db = reader.readLengthCodedString(data);
        this.table = reader.readLengthCodedString(data);
        this.originalTable = reader.readLengthCodedString(data);
        this.name = reader.readLengthCodedString(data);
        this.originalName = reader.readLengthCodedString(data);
        index = reader.getIndex();
        //
        index++;
        //
        this.character = ByteHelper.readUnsignedShortLittleEndian(data, index);
        index += 2;
        //
        this.length = ByteHelper.readUnsignedIntLittleEndian(data, index);
        index += 4;
        //
        this.type = data[index];
        index++;
        //
        this.flags = ByteHelper.readUnsignedShortLittleEndian(data, index);
        index += 2;
        //
        this.decimals = data[index];
        index++;
        //
        if (index < data.length) {
            reader.setIndex(index);
            this.definition = reader.readLengthCodedString(data);
        }
    }
View Full Code Here

TOP

Related Classes of com.alibaba.otter.canal.parse.driver.mysql.utils.LengthCodedStringReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.