当前位置: 首页>>代码示例>>Java>>正文


Java LowCopyProtostuffOutput类代码示例

本文整理汇总了Java中io.protostuff.LowCopyProtostuffOutput的典型用法代码示例。如果您正苦于以下问题:Java LowCopyProtostuffOutput类的具体用法?Java LowCopyProtostuffOutput怎么用?Java LowCopyProtostuffOutput使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


LowCopyProtostuffOutput类属于io.protostuff包,在下文中一共展示了LowCopyProtostuffOutput类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: serialize

import io.protostuff.LowCopyProtostuffOutput; //导入依赖的package包/类
@Override
public void serialize(RepositoryData repository, Buffer buffer) {
	changeClassLoaderIfRequired();

       ZeroCopyLinkBuffer zeroCopyLinkBuffer = linkedBuff.get();
       LowCopyProtostuffOutput lowCopyProtostuffOutput = output.get();

       zeroCopyLinkBuffer.withBuffer(buffer);
       lowCopyProtostuffOutput.buffer = zeroCopyLinkBuffer;

       try {
           repoSchema.writeTo(lowCopyProtostuffOutput, repository);
       } catch (IOException e) {
           throw new RuntimeException(e);
       }
}
 
开发者ID:dmart28,项目名称:reveno,代码行数:17,代码来源:ProtostuffSerializer.java

示例2: serializeObject

import io.protostuff.LowCopyProtostuffOutput; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void serializeObject(Buffer buffer, Object tc) {
       ZeroCopyLinkBuffer zeroCopyLinkBuffer = linkedBuff.get();
       LowCopyProtostuffOutput lowCopyProtostuffOutput = output.get();
	zeroCopyLinkBuffer.withBuffer(buffer);
	lowCopyProtostuffOutput.buffer = zeroCopyLinkBuffer;

	long crc = crcNames.get(tc.getClass());
       ProtoTransactionTypeHolder ptth = registeredCrc.get(crc);
	if (ptth.crcCollision) {
		byte[] key = sha1Names.get(tc.getClass());
		ptth = registeredSha1.get(key);
		buffer.writeByte(SHA1_TYPE);
		buffer.writeBytes(key, 0, SHA1_DIGEST_SIZE);
	} else {
		buffer.writeByte(CRC32_TYPE);
		buffer.writeLong(crc);
	}

       buffer.markSize();
	Schema<Object> schema = (Schema<Object>) ptth.schema;
       try {
           schema.writeTo(lowCopyProtostuffOutput, tc);
       } catch (IOException e) {
           throw new RuntimeException(e);
       }
	buffer.writeSize();
   }
 
开发者ID:dmart28,项目名称:reveno,代码行数:29,代码来源:ProtostuffSerializer.java

示例3: addLengthPrependedEntryBuffersToList

import io.protostuff.LowCopyProtostuffOutput; //导入依赖的package包/类
private static void addLengthPrependedEntryBuffersToList(RegionWalEntry entry, List<ByteBuffer> buffers)
    throws IOException {
  LinkBuffer entryBuffer = new LinkBuffer();
  LowCopyProtostuffOutput lcpo = new LowCopyProtostuffOutput(entryBuffer);
  RegionWalEntry.getSchema().writeTo(lcpo, entry);

  final int length = Ints.checkedCast(lcpo.buffer.size());
  final LinkBuffer lengthBuf = new LinkBuffer().writeVarInt32(length);

  buffers.addAll(lengthBuf.finish());
  buffers.addAll(entryBuffer.finish());
}
 
开发者ID:cloud-software-foundation,项目名称:c5,代码行数:13,代码来源:OLogShim.java

示例4: initialValue

import io.protostuff.LowCopyProtostuffOutput; //导入依赖的package包/类
protected LowCopyProtostuffOutput initialValue() {
    return new LowCopyProtostuffOutput();
}
 
开发者ID:dmart28,项目名称:reveno,代码行数:4,代码来源:ProtostuffSerializer.java


注:本文中的io.protostuff.LowCopyProtostuffOutput类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。