org.apache.avro.io.Encoder.writeArrayEnd()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(133)

本文整理了Java中org.apache.avro.io.Encoder.writeArrayEnd()方法的一些代码示例,展示了Encoder.writeArrayEnd()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Encoder.writeArrayEnd()方法的具体详情如下:
包路径:org.apache.avro.io.Encoder
类名称:Encoder
方法名:writeArrayEnd

Encoder.writeArrayEnd介绍

[英]Call this method to finish writing an array. See #writeArrayStart for usage information.
[中]调用此方法以完成数组的编写。有关用法信息,请参阅#writeArrayStart。

代码示例

代码示例来源:origin: apache/avro

@Override
public void writeArrayEnd() throws IOException { e.writeArrayEnd(); }
@Override

代码示例来源:origin: apache/avro

@Override
public void writeArrayEnd() throws IOException {
 parser.advance(Symbol.ARRAY_END);
 out.writeArrayEnd();
 pop();
}

代码示例来源:origin: org.apache.avro/avro

@Override
public void writeArrayEnd() throws IOException {
 parser.advance(Symbol.ARRAY_END);
 out.writeArrayEnd();
 pop();
}

代码示例来源:origin: org.apache.avro/avro

/** Called to write a array.  May be overridden for alternate array
 * representations.*/
protected void writeArray(Schema schema, Object datum, Encoder out)
 throws IOException {
 Schema element = schema.getElementType();
 long size = getArraySize(datum);
 long actualSize = 0;
 out.writeArrayStart();
 out.setItemCount(size);
 for (Iterator<? extends Object> it = getArrayElements(datum); it.hasNext();) {
  out.startItem();
  write(element, it.next(), out);
  actualSize++;
 }
 out.writeArrayEnd();
 if (actualSize != size) {
  throw new ConcurrentModificationException("Size of array written was " +
    size + ", but number of elements written was " + actualSize + ". ");
 }
}

代码示例来源:origin: apache/avro

/** Called to write a array.  May be overridden for alternate array
 * representations.*/
protected void writeArray(Schema schema, Object datum, Encoder out)
 throws IOException {
 Schema element = schema.getElementType();
 long size = getArraySize(datum);
 long actualSize = 0;
 out.writeArrayStart();
 out.setItemCount(size);
 for (Iterator<? extends Object> it = getArrayElements(datum); it.hasNext();) {
  out.startItem();
  write(element, it.next(), out);
  actualSize++;
 }
 out.writeArrayEnd();
 if (actualSize != size) {
  throw new ConcurrentModificationException("Size of array written was " +
    size + ", but number of elements written was " + actualSize + ". ");
 }
}

代码示例来源:origin: org.apache.avro/avro

arrayError(elementClass, type);
 out.writeArrayEnd();
} else {
 out.writeArrayStart();
 writeObjectArray(element, (Object[]) datum, out);
 out.writeArrayEnd();

代码示例来源:origin: apache/avro

arrayError(elementClass, type);
 out.writeArrayEnd();
} else {
 out.writeArrayStart();
 writeObjectArray(element, (Object[]) datum, out);
 out.writeArrayEnd();

代码示例来源:origin: apache/avro

@Override protected void customEncode(org.apache.avro.io.Encoder out)
 throws java.io.IOException
{
 long size0 = this.productsInCart.size();
 out.writeArrayStart();
 out.setItemCount(size0);
 long actualSize0 = 0;
 for (java.lang.String e0: this.productsInCart) {
  actualSize0++;
  out.startItem();
  out.writeString(e0);
 }
 out.writeArrayEnd();
 if (actualSize0 != size0)
  throw new java.util.ConcurrentModificationException("Array-size written was " + size0 + ", but element count was " + actualSize0 + ".");
}

代码示例来源:origin: apache/avro

@Override protected void customEncode(org.apache.avro.io.Encoder out)
 throws java.io.IOException
{
 out.writeString(this.label);
 long size0 = this.children.size();
 out.writeArrayStart();
 out.setItemCount(size0);
 long actualSize0 = 0;
 for (org.apache.avro.Node e0: this.children) {
  actualSize0++;
  out.startItem();
  e0.customEncode(out);
 }
 out.writeArrayEnd();
 if (actualSize0 != size0)
  throw new java.util.ConcurrentModificationException("Array-size written was " + size0 + ", but element count was " + actualSize0 + ".");
}

代码示例来源:origin: apache/avro

@Override protected void customEncode(org.apache.avro.io.Encoder out)
 throws java.io.IOException
{
 out.writeString(this.label);
 long size0 = this.children.size();
 out.writeArrayStart();
 out.setItemCount(size0);
 long actualSize0 = 0;
 for (org.apache.avro.Node e0: this.children) {
  actualSize0++;
  out.startItem();
  e0.customEncode(out);
 }
 out.writeArrayEnd();
 if (actualSize0 != size0)
  throw new java.util.ConcurrentModificationException("Array-size written was " + size0 + ", but element count was " + actualSize0 + ".");
}

代码示例来源:origin: apache/avro

@Override protected void customEncode(org.apache.avro.io.Encoder out)
 throws java.io.IOException
{
 out.writeEnum(this.method.ordinal());
 out.writeString(this.path);
 long size0 = this.parameters.size();
 out.writeArrayStart();
 out.setItemCount(size0);
 long actualSize0 = 0;
 for (org.apache.avro.test.http.QueryParameter e0: this.parameters) {
  actualSize0++;
  out.startItem();
  e0.customEncode(out);
 }
 out.writeArrayEnd();
 if (actualSize0 != size0)
  throw new java.util.ConcurrentModificationException("Array-size written was " + size0 + ", but element count was " + actualSize0 + ".");
}

代码示例来源:origin: apache/avro

e0.customEncode(out);
out.writeArrayEnd();
if (actualSize0 != size0)
 throw new java.util.ConcurrentModificationException("Array-size written was " + size0 + ", but element count was " + actualSize0 + ".");
 out.writeString(e1);
out.writeArrayEnd();
if (actualSize1 != size1)
 throw new java.util.ConcurrentModificationException("Array-size written was " + size1 + ", but element count was " + actualSize1 + ".");

代码示例来源:origin: apache/avro

@Override
 void writeInternal(Encoder e) throws IOException {
  int items = sourceData.length/4;
  e.writeArrayStart();
  e.setItemCount(1);
  e.startItem();
  e.writeArrayStart();
  e.setItemCount(items);
  for (int i = 0; i < sourceData.length;i+=4) {
   e.startItem();
   e.writeFloat(sourceData[i]);
   e.writeFloat(sourceData[i+1]);
   e.writeFloat(sourceData[i+2]);
   e.writeFloat(sourceData[i+3]);
  }
  e.writeArrayEnd();
  e.writeArrayEnd();
 }
}

代码示例来源:origin: apache/avro

out.writeString(e0);
out.writeArrayEnd();
if (actualSize0 != size0)
 throw new java.util.ConcurrentModificationException("Array-size written was " + size0 + ", but element count was " + actualSize0 + ".");
 out.writeInt(e1);
out.writeArrayEnd();
if (actualSize1 != size1)
 throw new java.util.ConcurrentModificationException("Array-size written was " + size1 + ", but element count was " + actualSize1 + ".");

代码示例来源:origin: apache/avro

write(element, out);
 out.writeArrayEnd();
 break;
case START_OBJECT:

代码示例来源:origin: apache/avro

out.writeString(e0);
out.writeArrayEnd();
if (actualSize0 != size0)
 throw new java.util.ConcurrentModificationException("Array-size written was " + size0 + ", but element count was " + actualSize0 + ".");
 out.writeInt(e1);
out.writeArrayEnd();
if (actualSize1 != size1)
 throw new java.util.ConcurrentModificationException("Array-size written was " + size1 + ", but element count was " + actualSize1 + ".");

代码示例来源:origin: apache/avro

case END_ARRAY:
 assertTrue(isArray[stackTop]);
 cos.writeArrayEnd();
 stackTop--;
 break;

代码示例来源:origin: org.apache.avro/avro

write(element, out);
 out.writeArrayEnd();
 break;
case START_OBJECT:

代码示例来源:origin: apache/avro

out.writeString(e1);
out.writeArrayEnd();
if (actualSize1 != size1)
 throw new java.util.ConcurrentModificationException("Array-size written was " + size1 + ", but element count was " + actualSize1 + ".");

代码示例来源:origin: apache/avro

static void generateComplexData(Encoder e) throws IOException {
 e.writeArrayStart();
 e.setItemCount(1);
 e.startItem();
 e.writeInt(1);
 e.writeArrayEnd();
 e.writeMapStart();
 e.setItemCount(2);
 e.startItem();
 e.writeString("foo");
 e.writeInt(-1);
 e.writeDouble(33.3);
 e.startItem();
 e.writeString("bar");
 e.writeInt(1);
 e.writeDouble(-33.3);
 e.writeMapEnd();
 e.flush();
}

相关文章