Fix buffer overflow bug when expanding ByteBuffer in
AnnotatedCompositeSerializer