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

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

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

Encoder.writeLong介绍

[英]Write a 64-bit integer.
[中]写一个64位整数。

代码示例

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

@Override
 protected void write(Object object, Encoder out) throws IOException {
  out.writeLong(UNSAFE.getLong(object, offset));
 }
}

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

@Override
protected final void write(Object datum, Encoder out) throws IOException {
 out.writeLong(((Date)datum).getTime());
}

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

@Override
protected final void write(Object datum, Encoder out) throws IOException {
 out.writeLong(((Date)datum).getTime());
}

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

@Override
 protected void write(Object object, Encoder out) throws IOException {
  out.writeLong(UNSAFE.getLong(object, offset));
 }
}

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

@Override
void writeInternal(Encoder e) throws IOException {
 for (int i = 0; i < sourceData.length;i+=4) {
  e.writeLong(sourceData[i]);
  e.writeLong(sourceData[i+1]);
  e.writeLong(sourceData[i+2]);
  e.writeLong(sourceData[i+3]);
 }
}

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

@Override
 void writeInternal(Encoder e) throws IOException {
  for (int i = 0; i < sourceData.length; i+=4) {
   e.writeLong(sourceData[i]);
   e.writeLong(sourceData[i+1]);
   e.writeLong(sourceData[i+2]);
   e.writeLong(sourceData[i+3]);
  }
 }
}

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

@Override
public void writeLong(long n) throws IOException {
 parser.advance(Symbol.LONG);
 out.writeLong(n);
}

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

@Override
public void writeLong(long n) throws IOException {
 parser.advance(Symbol.LONG);
 out.writeLong(n);
}

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

@Override
public void writeLong(long n) throws IOException { e.writeLong(n); }
@Override

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

static void writeArray(long[] data, Encoder out) throws IOException {
 int size = data.length;
 out.setItemCount(size);
 for (int i = 0; i < size; i++) {
  out.startItem();
  out.writeLong(data[i]);
 }
}

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

static void writeArray(long[] data, Encoder out) throws IOException {
 int size = data.length;
 out.setItemCount(size);
 for (int i = 0; i < size; i++) {
  out.startItem();
  out.writeLong(data[i]);
 }
}

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

private static void writeBlock(Encoder vout, FileOutputStream out)
       throws IOException{
 vout.writeLong(blockCount);
 bufOut.flush();
 buffer.writeTo(out);
 buffer.reset();
 blockCount = 0;
}

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

@Override protected void customEncode(org.apache.avro.io.Encoder out)
 throws java.io.IOException
{
 out.writeLong(this.timestamp);
 this.ping.customEncode(out);
}

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

@Override protected void customEncode(org.apache.avro.io.Encoder out)
 throws java.io.IOException
{
 out.writeLong(this.timestamp);
 out.writeString(this.text);
}

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

@Override protected void customEncode(org.apache.avro.io.Encoder out)
 throws java.io.IOException
{
 out.writeString(this.name);
 out.writeLong(this.value);
}

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

@Override protected void customEncode(org.apache.avro.io.Encoder out)
 throws java.io.IOException
{
 out.writeString(this.station);
 out.writeLong(this.time);
 out.writeInt(this.temp);
}

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

@Override protected void customEncode(org.apache.avro.io.Encoder out)
 throws java.io.IOException
{
 out.writeString(this.name);
 out.writeLong(this.value);
 out.writeString(this.data);
}

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

@Override protected void customEncode(org.apache.avro.io.Encoder out)
 throws java.io.IOException
{
 out.writeString(this.station);
 out.writeLong(this.time);
 out.writeInt(this.temp);
}

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

@Test(expected = EOFException.class)
public void testEOF() throws IOException {
 ByteArrayOutputStream baos = new ByteArrayOutputStream();
 Encoder e = EncoderFactory.get().binaryEncoder(baos, null);
 e.writeLong(0x10000000000000L);
 e.flush();
 Decoder d = newDecoder(new ByteArrayInputStream(baos.toByteArray()));
 Assert.assertEquals(0x10000000000000L, d.readLong());
 d.readInt();
}

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

@Override protected void customEncode(org.apache.avro.io.Encoder out)
 throws java.io.IOException
{
 out.writeLong(this.timestamp);
 if (this.connection == null) {
  out.writeIndex(0);
  out.writeNull();
 } else {
  out.writeIndex(1);
  this.connection.customEncode(out);
 }
 this.httpRequest.customEncode(out);
}

相关文章