@Test public void testListWithNull() { final AttributeValue av = AttributeValueBuilder.ofL( AttributeValueBuilder.ofS("StringValue"), AttributeValueBuilder.ofN("1000"), AttributeValueBuilder.ofBool(Boolean.TRUE), null); try { marshall(av); } catch (NullPointerException e) { assertThat(e.getMessage(), startsWith("Encountered null list entry value while marshalling attribute value")); } }
public static ByteBuffer marshall(final AttributeValue attributeValue) { try (ByteArrayOutputStream resultBytes = new ByteArrayOutputStream(); DataOutputStream out = new DataOutputStream(resultBytes);) { marshall(attributeValue, out); out.close(); resultBytes.close(); return ByteBuffer.wrap(resultBytes.toByteArray()); } catch (final IOException ex) { throw new RuntimeException("Unexpected exception", ex); } }
AttributeValueMarshaller { public static ByteBuffer marshall(final AttributeValue attributeValue) { try (ByteArrayOutputStream resultBytes = new ByteArrayOutputStream(); DataOutputStream out = new DataOutputStream(resultBytes);) { marshall(attributeValue, out); out.close(); resultBytes.close(); return ByteBuffer.wrap(resultBytes.toByteArray()); } catch (final IOException ex) { throw new RuntimeException("Unexpected exception", ex); } } }
AttributeValueMarshaller { public static ByteBuffer marshall(final AttributeValue attributeValue) { try (ByteArrayOutputStream resultBytes = new ByteArrayOutputStream(); DataOutputStream out = new DataOutputStream(resultBytes);) { marshall(attributeValue, out); out.close(); resultBytes.close(); return ByteBuffer.wrap(resultBytes.toByteArray()); } catch (final IOException ex) { throw new RuntimeException("Unexpected exception", ex); } } private  AttributeValueMarshaller(); }
AttributeValueMarshaller { public static ByteBuffer marshall(final AttributeValue attributeValue) { try (ByteArrayOutputStream resultBytes = new ByteArrayOutputStream(); DataOutputStream out = new DataOutputStream(resultBytes);) { marshall(attributeValue, out); out.close(); resultBytes.close(); return ByteBuffer.wrap(resultBytes.toByteArray()); } catch (final IOException ex) { throw new RuntimeException("Unexpected exception", ex); } } private  AttributeValueMarshaller(); static ByteBuffer marshall(final AttributeValue attributeValue); static AttributeValue unmarshall(final ByteBuffer plainText); }
AttributeValueMarshaller { public static ByteBuffer marshall(final AttributeValue attributeValue) { try (ByteArrayOutputStream resultBytes = new ByteArrayOutputStream(); DataOutputStream out = new DataOutputStream(resultBytes);) { marshall(attributeValue, out); out.close(); resultBytes.close(); return ByteBuffer.wrap(resultBytes.toByteArray()); } catch (final IOException ex) { throw new RuntimeException("Unexpected exception", ex); } } private  AttributeValueMarshaller(); static ByteBuffer marshall(final AttributeValue attributeValue); static AttributeValue unmarshall(final ByteBuffer plainText);  }