@Test public void testPrimitiveArrays() throws Exception { JavaSerializationMarshaller marshaller = new JavaSerializationMarshaller(); byte[] bytes = marshaller.objectToByteBuffer(new byte[0]); assertArrayEquals(new byte[0], (byte[]) marshaller.objectFromByteBuffer(bytes)); bytes = marshaller.objectToByteBuffer(new short[0]); assertArrayEquals(new short[0], (short[]) marshaller.objectFromByteBuffer(bytes)); bytes = marshaller.objectToByteBuffer(new int[0]); assertArrayEquals(new int[0], (int[]) marshaller.objectFromByteBuffer(bytes)); bytes = marshaller.objectToByteBuffer(new long[0]); assertArrayEquals(new long[0], (long[]) marshaller.objectFromByteBuffer(bytes)); bytes = marshaller.objectToByteBuffer(new float[0]); assertArrayEquals(new float[0], (float[]) marshaller.objectFromByteBuffer(bytes), 0); bytes = marshaller.objectToByteBuffer(new double[0]); assertArrayEquals(new double[0], (double[]) marshaller.objectFromByteBuffer(bytes), 0); bytes = marshaller.objectToByteBuffer(new char[0]); assertArrayEquals(new char[0], (char[]) marshaller.objectFromByteBuffer(bytes)); bytes = marshaller.objectToByteBuffer(new boolean[0]); assertArrayEquals(new boolean[0], (boolean[]) marshaller.objectFromByteBuffer(bytes)); }
@Override public Object objectFromByteBuffer(byte[] buf, int offset, int length) throws IOException, ClassNotFoundException { try (ObjectInputStream ois = new CheckedInputStream(new ByteArrayInputStream(buf), allowList)) { return ois.readObject(); } }
JavaSerializationMarshaller extends AbstractMarshaller { @Override public Object objectFromByteBuffer(byte[] buf, int offset, int length) throws IOException, ClassNotFoundException { try (ObjectInputStream ois = new CheckedInputStream(new ByteArrayInputStream(buf), allowList)) { return ois.readObject(); } } }
JavaSerializationMarshaller extends AbstractMarshaller { @Override public Object objectFromByteBuffer(byte[] buf, int offset, int length) throws IOException, ClassNotFoundException { try (ObjectInputStream ois = new CheckedInputStream(new ByteArrayInputStream(buf), allowList)) { return ois.readObject(); } } JavaSerializationMarshaller();  JavaSerializationMarshaller(ClassAllowList allowList); }
JavaSerializationMarshaller extends AbstractMarshaller { @Override public Object objectFromByteBuffer(byte[] buf, int offset, int length) throws IOException, ClassNotFoundException { try (ObjectInputStream ois = new CheckedInputStream(new ByteArrayInputStream(buf), allowList)) { return ois.readObject(); } } JavaSerializationMarshaller();  JavaSerializationMarshaller(ClassAllowList allowList); @Override void initialize(ClassAllowList classAllowList); @Override Object objectFromByteBuffer(byte[] buf, int offset, int length); @Override boolean isMarshallable(Object o); @Override MediaType mediaType(); }
JavaSerializationMarshaller extends AbstractMarshaller { @Override public Object objectFromByteBuffer(byte[] buf, int offset, int length) throws IOException, ClassNotFoundException { try (ObjectInputStream ois = new CheckedInputStream(new ByteArrayInputStream(buf), allowList)) { return ois.readObject(); } } JavaSerializationMarshaller();  JavaSerializationMarshaller(ClassAllowList allowList); @Override void initialize(ClassAllowList classAllowList); @Override Object objectFromByteBuffer(byte[] buf, int offset, int length); @Override boolean isMarshallable(Object o); @Override MediaType mediaType();  }