/* (non-Javadoc)
@see tuwien.auto.calimero.dptxlator.DPTXlator#getData(byte[], int)
14285
public byte[] getData(byte[] dst, int offset)
	{
		final int end = Math.min(data.length, dst.length - offset) / 3 * 3;
		for (int i = 0; i < end; ++i)
			dst[offset + i] = (byte) data[i];
		return dst;
	}

	/* (non-Javadoc)
	 * @see tuwien.auto.calimero.dptxlator.DPTXlator#getSubTypes()
	 */
	public Map getSubTypes()
	{
		return types;
	}

	/**
	 * @return the subtypes of the time translator type
	 * @see DPTXlator#getSubTypesStatic()
	 */
	protected static Map getSubTypesStatic()
	{
		return types;
	}

	private String fromDPT(int index)
	{
		if (sdf != null)
			synchronized (DPTXlatorTime.class) {
				return sdf.format(new Date(fromDPTMillis(index)));
			}
		final int i = index * 3;
		// dow, hh:mm:ss
		final int h = data[i + HOUR] & 0x1F;
		final int m = data[i + MINUTE];
		final int s = data[i + SECOND];
		return DAYS[data[i + DOW] >> 5] + ", " + align(h) + h + ':' + align(m) + m + ':'
			+ align(s) + s;
	}

	private long fromDPTMillis(int index)
	{
		synchronized (DPTXlatorTime.class) {
			getCalendar().clear();
			final int i = index * 3;
			final int dow = data[i] >> 5 & 0x7;
			if (dow > 0)
				c.set(Calendar.DAY_OF_WEEK, dow == 7 ? 1 : dow + 1);
			c.set(Calendar.HOUR_OF_DAY, data[i + HOUR] & 0x1F);
			c.set(Calendar.MINUTE, data[i + MINUTE]);
			c.set(Calendar.SECOND, data[i + SECOND]);
			long ms = 0;
			try {
				ms = c.getTimeInMillis();
			}
			catch (final IllegalArgumentException e) {
				DPTXlator.logger.error("from DPT in milliseconds not possible");
			}
			return ms;
		}
	}

	protected void toDPT(String value, short[] dst, int index) throws KNXFormatException
	{
		if (sdf != null)
			synchronized (DPTXlatorTime.class) {
				toDPT(parse(value), dst, index);
				return;
			}
		final StringTokenizer t = new StringTokenizer(value, ": ,");
		final int maxTokens = 4;
		final String[] tokens = new String[maxTokens];
		// extract tokens
		int count = 0;
		for (; count < maxTokens && t.hasMoreTokens(); ++count)
			tokens[count] = t.nextToken();
		// we allow day of week to be omitted in value
		if (count < 3)
			throw logThrow(LogLevel.WARN, "invalid time " + value, null, value);
		// on 4 tokens, day of week is included
		final int dow = count == 4 ? getDOW(tokens[0]) : 0;
		try {
			final int s = Short.parseShort(tokens[--count]);
			final int m = Short.parseShort(tokens[--count]);
			final int h = Short.parseShort(tokens[--count]);
			set(dow, h, m, s, dst, index);
		}
		catch (final KNXIllegalArgumentException e) {
			throw logThrow(LogLevel.WARN, "invalid time " + value, e.getMessage(), value);
		}
		catch (final NumberFormatException e) {
			throw logThrow(LogLevel.WARN, "invalid number in " + value, null, value);
		}
	}

	private short[] toDPT(long milliseconds, short[] dst, int index)
	{
		synchronized (DPTXlatorTime.class) {
			getCalendar().clear();
			c.setTimeInMillis(milliseconds);
			final int dow = c.get(Calendar.DAY_OF_WEEK);
			set(dow == Calendar.SUNDAY ? 7 : dow - 1, c
				.get(Calendar.HOUR_OF_DAY), c.get(Calendar.MINUTE), c
				.get(Calendar.SECOND), dst, index);
		}
		return dst;
	}

	private short[] set(int dow, int hour, int minute, int second, short[] dst, int index)
	{
		if (dow < 0 || dow > 7)
			throw new KNXIllegalArgumentException("day of week out of range [0..7]");
		if (hour < 0 || hour > 23)
			throw new KNXIllegalArgumentException("hour out of range [0..23]");
		if (minute < 0 || minute > 59)
			throw new KNXIllegalArgumentException("minute out of range [0..59]");
		if (second < 0 || second > 59)
			throw new KNXIllegalArgumentException("second out of range [0..59]");
		final int i = 3 * index;
		dst[i + DOW] = (short) (dow << 5 | hour);
		dst[i + MINUTE] = (short) minute;
		dst[i + SECOND] = (short) second;
		return dst;
	}

	private int getDOW(String dow) throws KNXFormatException
	{
		for (int i = 0; i < DAYS.length; ++i)
			if (DAYS[i].equalsIgnoreCase(dow))
				return i;
		throw logThrow(LogLevel.WARN, "invalid day of week " + dow, null, dow);
	}

	private long parse(String value) throws KNXFormatException
	{
		try {
			return sdf.parse(value).getTime();
		}
		catch (final ParseException e) {
			throw logThrow(LogLevel.WARN, "invalid time format", e.getMessage(), value);
		}
	}

	private static String align(int number)
	{
		return number > 9 ? "" : "0";
	}

	private static Calendar getCalendar()
	{
		// don't need to synchronize, it's harmless if we have 2 instances
		// and we synchronize on class anyway
		if (c == null) {
			final Calendar calendar = Calendar.getInstance();
			calendar.setLenient(false);
			c = calendar;
		}
		return c;
	}
}
916383
@Override
	public void setData(final byte[] data, final int offset)
	{
		if (offset < 0 || offset > data.length)
			throw new KNXIllegalArgumentException("illegal offset " + offset);
		toDPT(data, offset);
	}
778502
def get_data_byte_array(self, buffer=False):
        """"""
        if buffer:
            length = len(self.dataList)
            return BytesIO(pack(">i", length)+self.get_data_byte_array())
        else:
            return array.array('B', self.dataList).tostring()
1310840
public byte[] getDataBytes() throws IOException {
        byte[] retVal = new byte[length];
        synchronized (data) {
            data.reset();
            data.getBytes(retVal);
        }
        return retVal;
    }
1029462
synchronized int read(byte[] data) {
        this.header = getHeaderParser().setData(data).parseHeader();
        if (data != null) {
            setData(header, data);
        }

        return status;
    }
1083989
@Override
    public final int read(byte[] pBytes) throws IOException {
        return read(pBytes, 0, pBytes != null ? pBytes.length : 1);
    }
21485
@Override
   public byte[] getData() {
       byte[] data = new byte[frameData.length+2];

       int first2 = (FRAME_SYNC<<2);
       if (blockSizeVariable) first2++;

       IOUtils.putInt2BE(data, 0, first2);
       System.arraycopy(frameData, 0, data, 2, frameData.length);

       return data;
   }
878296
private static int get(byte[] block, int offset, byte[] b, int off, int len) {
    System.arraycopy(block, offset, b, off, len);
    return len;
  }
534138
@Override
    public byte[] getBytes(int columnIndex) throws SQLException {
        checkColumnBounds(columnIndex);
        try {
            if (table.getColumnType(columnIndex - 1) == VoltType.STRING)
                return table.getStringAsBytes(columnIndex - 1);
            else if (table.getColumnType(columnIndex - 1) == VoltType.VARBINARY)
                return table.getVarbinary(columnIndex - 1);
            else
                throw SQLError.get(SQLError.CONVERSION_NOT_FOUND,
                        table.getColumnType(columnIndex - 1), "byte[]");
        } catch (SQLException x) {
            throw x;
        } catch (Exception x) {
            throw SQLError.get(x);
        }
    }
948852
protected boolean loadDat(ByteArray byteArray)
    {
        V[] valueArray = loadValueArray(byteArray);
        if (valueArray == null)
        {
            return false;
        }
        return trie.load(byteArray.getBytes(), byteArray.getOffset(), valueArray);
    }
561345
public byte[] getData() {
		byte[] ret = new byte[byteTab.length];
		System.arraycopy(byteTab, 0, ret, 0, byteTab.length);
		return ret;
	}
1267329
@Override
    public Boolean get(int i) {
        byte b = data.getByte(i);
        if (b == BooleanColumnType.BYTE_TRUE) {
            return Boolean.TRUE;
        }
        if (b == BooleanColumnType.BYTE_FALSE) {
            return Boolean.FALSE;
        }
        return null;
    }
637028
protected Object getFieldData(Integer id, FieldType type, byte[][] fixedData, Var2Data varData)
   {
      Object result = null;

      FieldItem item = m_map.get(type);
      if (item != null)
      {
         result = item.read(id, fixedData, varData);
      }

      return result;
   }
413668
@Override
    public byte[] getBytes(int position, int length) {
        byte[] result = new byte[length];
        for (int i = 0; i < length; i++) {
            result[i]=getByte(position);
            position += BYTE_LEN;
        }
        return result;
    }
541468
public static byte[] domainControllerDataToByteBuffer(List<DomainControllerData> data) throws Exception {
        final ByteArrayOutputStream out_stream = new ByteArrayOutputStream(512);
        byte[] result;
        try (DataOutputStream out = new DataOutputStream(out_stream)) {
            Iterator<DomainControllerData> iter = data.iterator();
            while (iter.hasNext()) {
                DomainControllerData dcData = iter.next();
                dcData.writeTo(out);
                if (iter.hasNext()) {
                    S3Util.writeString(SEPARATOR, out);
                }
            }
            result = out_stream.toByteArray();
        }
        return result;
    }
815460
@Override
  public ByteBuffer getBytes() {
    ByteBuffer bb = ByteBuffer.allocate(HEADER_LENGTH + getTotalbody());
    bb.put(magic.getMagic());
    bb.put(opcode.getOpcode());
    bb.putShort(keylength);
    bb.put(extralength);
    bb.put(datatype);
    bb.putShort(vbucket);
    bb.putInt(totalbody);
    bb.putInt(opaque);
    bb.putLong(cas);

    if (hasFlags) {
      int flag = 0;
      for (int i = 0; i < flagList.size(); i++) {
        flag |= flagList.get(i).getFlags();
      }
      bb.putInt(flag);
    }
    bb.put(name.getBytes());
    if (hasBackfill) {
      bb.putLong(backfilldate);
    }
    if (hasVBucketList) {
      bb.putShort((short) vblist.length);
      for (int i = 0; i < vblist.length; i++) {
        bb.putShort(vblist[i]);
      }
    }
    if (hasVBucketCheckpoints) {
      bb.putShort((short)vBucketCheckpoints.size());
      for (Short vBucket : vBucketCheckpoints.keySet()) {
        bb.putShort(vBucket);
        bb.putLong(vBucketCheckpoints.get(vBucket));
      }
    }

    return (ByteBuffer) bb.flip();
  }
614409
public <T> T getDataAttr(String dPath, Class<T> clazz) {
        Lock lock = lockForRead();
        try {
            return DPathUtils.getValue(dataJson, dPath, clazz);
        } finally {
            lock.unlock();
        }
    }