public T read(Timestamp currentDateTime) throws IOException {
        Deal deal = new Deal();

        int type = dataInput.readUnsignedByte();

        if ((type & DealFlags.DATE_TIME.getValue()) > 0) {
            lassMillis = DataReader.readGrowing(dataInput, lassMillis);
        }
//        Timestamp timestamp = Utils.millis2Timestamp(lassMillis);
        deal.setTime(currentDateTime);
        if ((type & DealFlags.ID.getValue()) > 0) {
            lastId = DataReader.readGrowing(dataInput, lastId);
        }
        if ((type & DealFlags.ORDER_ID.getValue()) > 0) {
            DataReader.readLeb128(dataInput);
        }

        if ((type & DealFlags.PRICE.getValue()) > 0) {
            lastPrice += DataReader.readLeb128(dataInput);
        }
        deal.setPrice(lastPrice * stepPrice);

        if ((type & DealFlags.VOLUME.getValue()) > 0) {
            lastVolume = (int)DataReader.readLeb128(dataInput);
        }
        if ((type & DealFlags.OI.getValue()) > 0) {
            lastOI += (int)DataReader.readLeb128(dataInput);
        }
        deal.setVolume(lastVolume);

//        int dealType = type & DealFlags.TYPE.getValue();
        int dealType = type & DealFlags.TYPE.getValue();

        if (dealType == 2) {
            deal.setType(DealType.SELL);
        } else if (dealType == 1) {
            deal.setType(DealType.BUY);
        } else {//if (dealType == 0) {
            deal.setType(DealType.UNKNOWN);
        }

        deal.setSymbol(symbol);
        return (T) deal;
    }