當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。