@Test public void test_deserialize_failure() { exception.expect(DiagnosticCodecException.class); codec.deserialize(new byte[0], getClass()); }
@Override public <T> T deserialize(byte[] encoded, Class<T> target) throws DiagnosticCodecException { requireNonNull(encoded); requireNonNull(target); try (ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(encoded))) { return target.cast(ois.readObject()); } catch (Exception e) { throw new DiagnosticCodecException(e); } }
JavaDiagnosticCodec extends DiagnosticCodecSkeleton<byte[]> { @Override public <T> T deserialize(byte[] encoded, Class<T> target) throws DiagnosticCodecException { requireNonNull(encoded); requireNonNull(target); try (ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(encoded))) { return target.cast(ois.readObject()); } catch (Exception e) { throw new DiagnosticCodecException(e); } } }
JavaDiagnosticCodec extends DiagnosticCodecSkeleton<byte[]> { @Override public <T> T deserialize(byte[] encoded, Class<T> target) throws DiagnosticCodecException { requireNonNull(encoded); requireNonNull(target); try (ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(encoded))) { return target.cast(ois.readObject()); } catch (Exception e) { throw new DiagnosticCodecException(e); } } JavaDiagnosticCodec(); }
JavaDiagnosticCodec extends DiagnosticCodecSkeleton<byte[]> { @Override public <T> T deserialize(byte[] encoded, Class<T> target) throws DiagnosticCodecException { requireNonNull(encoded); requireNonNull(target); try (ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(encoded))) { return target.cast(ois.readObject()); } catch (Exception e) { throw new DiagnosticCodecException(e); } } JavaDiagnosticCodec(); @Override byte[] serialize(Object o); @Override T deserialize(byte[] encoded, Class<T> target); @Override String toString(); }
JavaDiagnosticCodec extends DiagnosticCodecSkeleton<byte[]> { @Override public <T> T deserialize(byte[] encoded, Class<T> target) throws DiagnosticCodecException { requireNonNull(encoded); requireNonNull(target); try (ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(encoded))) { return target.cast(ois.readObject()); } catch (Exception e) { throw new DiagnosticCodecException(e); } } JavaDiagnosticCodec(); @Override byte[] serialize(Object o); @Override T deserialize(byte[] encoded, Class<T> target); @Override String toString();  }