0

When using Google's FlatBuffer, the type that ends up being used is a ByteBuffer (which can just wrap a byte[]). I am using this with an HttpServletResponse. The problem becomes the Servlets PrintWriter does not offer byte[] or ByteBuffer writing.

Any tips in being able to output from an HttpServletResponse without having to copy the ByteBuffer/byte[] into another type?

ThePrimeagen
  • 4,462
  • 4
  • 31
  • 44

1 Answers1

0

Sorry for the question as I have found the answer in this PDF question: How to send byte[] as pdf to browser in java web application?

It turns out the servlet has an getOutputStream method which offers a byte[] write method.

Community
  • 1
  • 1
ThePrimeagen
  • 4,462
  • 4
  • 31
  • 44