maybe you could let the createResponse(..) method let take the buffer directly and save byte copies