package org.telegram.tl;

/**
 * Created by ex3ndr on 10.02.14.
 */
public class TLBytes {
    private byte[] data;
    private int offset;
    private int len;

    public TLBytes(byte[] data, int offset, int len) {
        this.data = data;
        this.offset = offset;
        this.len = len;
    }

    public byte[] getData() {
        return data;
    }

    public int getOffset() {
        return offset;
    }

    public int getLength() {
        return len;
    }
}

@@ -19,16 +19,42 @@
 am.tl;%0A%0A
+import java.util.Arrays;%0A%0A
 /**%0A * C
@@ -181,16 +181,140 @@
 t len;%0A%0A
+    public TLBytes(byte%5B%5D data) %7B%0A        this.data = data;%0A        this.offset = 0;%0A        this.len = data.length;%0A    %7D%0A%0A
     publ
@@ -589,24 +589,24 @@
 tLength() %7B%0A
-
         retu
@@ -618,11 +618,188 @@
 n;%0A    %7D
+%0A%0A    public byte%5B%5D cleanData() %7B%0A        if (offset == 0 && len == data.length) %7B%0A            return data;%0A        %7D%0A        return Arrays.copyOfRange(data, offset, len);%0A    %7D
 %0A%7D%0A

Clean data for TLBytes