@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();
      }
   }
@Test
   public void testPrimitiveArrays() throws Exception {
      JavaSerializationMarshaller marshaller = new JavaSerializationMarshaller();

      byte[] bytes = marshaller.objectToByteBuffer(Util.EMPTY_BYTE_ARRAY);
      assertArrayEquals(Util.EMPTY_BYTE_ARRAY, (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));
   }