use of com.amazon.ion.IonSexp in project ion-java by amzn.
the class _Private_CurriedValueFactory method newSexp.
public IonSexp newSexp(long[] values) {
IonSexp v = myFactory.newSexp(values);
handle(v);
return v;
}
use of com.amazon.ion.IonSexp in project ion-java by amzn.
the class _Private_CurriedValueFactory method newSexp.
public IonSexp newSexp(IonValue... values) throws ContainedValueException, NullPointerException {
IonSexp v = myFactory.newSexp(values);
handle(v);
return v;
}
use of com.amazon.ion.IonSexp in project ion-java by amzn.
the class _Private_CurriedValueFactory method newEmptySexp.
public IonSexp newEmptySexp() {
IonSexp v = myFactory.newEmptySexp();
handle(v);
return v;
}
use of com.amazon.ion.IonSexp in project ion-java by amzn.
the class _Private_CurriedValueFactory method newNullSexp.
// -------------------------------------------------------------------------
public IonSexp newNullSexp() {
IonSexp v = myFactory.newNullSexp();
handle(v);
return v;
}
use of com.amazon.ion.IonSexp in project ion-java by amzn.
the class OptimizedBinaryWriterLengthPatchingTest method testOptimizedWriteLengthPatching.
/**
* Tests that the internal implementation of binary {@link IonWriter}'s
* patching mechanism is correct.
*
* @see IonWriterSystemBinary
*/
@Test
public void testOptimizedWriteLengthPatching() throws Exception {
iw = makeWriter();
// The expected datagram - as values are copied to the IonWriter, we
// book-keep the values written so as to do an equality check at the end.
IonDatagram expected = system().newDatagram();
// === top level ===
writeAndAddTypeDescLengthVariants(expected);
// === nested list ===
iw.stepIn(IonType.LIST);
IonList expectedNestedList = expected.add().newEmptyList();
{
writeAndAddTypeDescLengthVariants(expectedNestedList);
}
iw.stepOut();
// === nested sexp ===
iw.stepIn(IonType.SEXP);
IonSexp expectedNestedSexp = expected.add().newEmptySexp();
{
writeAndAddTypeDescLengthVariants(expectedNestedSexp);
}
iw.stepOut();
// === nested struct ===
iw.stepIn(IonType.STRUCT);
IonStruct expectedNestedStruct = expected.add().newEmptyStruct();
{
writeAndAddTypeDescLengthVariants(expectedNestedStruct);
}
iw.stepOut();
// === deeply nested list ===
iw.stepIn(IonType.LIST);
IonList nestedList1 = expected.add().newEmptyList();
{
writeAndAddTypeDescLengthVariants(nestedList1);
iw.stepIn(IonType.LIST);
{
IonList nestedList2 = nestedList1.add().newEmptyList();
writeAndAddTypeDescLengthVariants(nestedList2);
}
iw.stepOut();
}
iw.stepOut();
IonDatagram actual = loader().load(outputByteArray());
assertIonEquals(expected, actual);
}
Aggregations