protected internal override void Encode(ChannelHandlerContext ctx, FileHeader msg, ByteBuf @out) { string name = msg.FileName(); sbyte[] bytes = UTF8.encode(name); @out.writeInt(bytes.Length); @out.writeBytes(bytes); @out.writeInt(msg.RequiredAlignment()); }
public static void Marshal(ByteBuf buffer, string @string) { if (string.ReferenceEquals(@string, null)) { buffer.writeInt(NULL_STRING_LENGTH); } else { sbyte[] bytes = @string.GetBytes(UTF_8); buffer.writeInt(bytes.Length); buffer.writeBytes(bytes); } }
internal static ByteBuf SerializeTerms(RaftLogEntry[] raftLogEntries, ByteBufAllocator byteBufAllocator) { int capacity = (sizeof(sbyte) * 8) + (sizeof(int) * 8) + (sizeof(long) * 8) * raftLogEntries.Length; ByteBuf buffer = byteBufAllocator.buffer(capacity, capacity); buffer.writeByte(ContentType.RaftLogEntryTerms.get()); buffer.writeInt(raftLogEntries.Length); foreach (RaftLogEntry raftLogEntry in raftLogEntries) { buffer.writeLong(raftLogEntry.Term()); } return(buffer); }
protected internal override void Encode(ChannelHandlerContext ctx, TxStreamFinishedResponse response, ByteBuf @out) { @out.writeInt(response.Status().ordinal()); @out.writeLong(response.LatestTxId()); }
public override WritableChannel PutInt(int value) { @delegate.writeInt(value); return(this); }
protected internal override void Encode(ChannelHandlerContext ctx, StoreCopyFinishedResponse msg, ByteBuf @out) { @out.writeInt(msg.Status().ordinal()); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public org.neo4j.storageengine.api.WritableChannel putInt(int value) throws MessageTooBigException public override WritableChannel PutInt(int value) { CheckSize(Integer.BYTES); @delegate.writeInt(value); return(this); }