Why not just provide a stream - you can construct a byte array from a steam using ByteArrayInputStream