Esempio n. 1
0
        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());
        }
Esempio n. 2
0
 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);
     }
 }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
 protected internal override void Encode(ChannelHandlerContext ctx, TxStreamFinishedResponse response, ByteBuf @out)
 {
     @out.writeInt(response.Status().ordinal());
     @out.writeLong(response.LatestTxId());
 }
Esempio n. 5
0
 public override WritableChannel PutInt(int value)
 {
     @delegate.writeInt(value);
     return(this);
 }
Esempio n. 6
0
 protected internal override void Encode(ChannelHandlerContext ctx, StoreCopyFinishedResponse msg, ByteBuf @out)
 {
     @out.writeInt(msg.Status().ordinal());
 }
Esempio n. 7
0
//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);
        }