Add putBytes(byte[], int, int) and update tests