Won't you end up with a byte buffer much larger than the one you actually need in this case?