added ITexture#allocate and ITexture#write