only allocate the CharBuffer if the type we're serializing will actually use the buffer