长度和内容都可以修改
pragma solidity ^0.4.6;
contract TestCreateBytes{
bytes public b = new bytes(1);
function getLength() constant returns(uint){
return b.length;
}
function setLength(uint len){
b.length = len;
}
function setIndexValue(byte data, uint index){
b[index] = data;
}
}