toByteBuffer method