static byte[] toByteArray(ByteArrayOutputStream baos) { ret baos == null ? null : baos.toByteArray(); } static byte[] toByteArray(O o) { if (o == null) null; if (o cast byte[]) ret o; // not sure what else to put here fail("toByteArray", o); }