@Override
public void appendStripe(byte[] stripe, int offset, int length,
StripeInformation stripeInfo,
OrcProto.StripeStatistics stripeStatistics) throws IOException {
checkArgument(stripe != null, "Stripe must not be null");
checkArgument(length <= stripe.length,
"Specified length must not be greater specified array length");
checkArgument(stripeInfo != null, "Stripe information must not be null");
checkArgument(stripeStatistics != null,
"Stripe statistics must not be null");
rowsInStripe = stripeInfo.getNumberOfRows();
OrcProto.StripeInformation.Builder dirEntry = OrcProto.StripeInformation
.newBuilder()
.setNumberOfRows(rowsInStripe)
.setIndexLength(stripeInfo.getIndexLength())
.setDataLength(stripeInfo.getDataLength())
.setFooterLength(stripeInfo.getFooterLength());
physicalWriter.appendRawStripe(ByteBuffer.wrap(stripe, offset, length),
dirEntry);
treeWriter.updateFileStatistics(stripeStatistics);
fileMetadata.addStripeStats(stripeStatistics);
stripes.add(dirEntry.build());
rowCount += rowsInStripe;
rowsInStripe = 0;
}