io.rsocket.frame.ResumeOkFrameCodec Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rsocket-core Show documentation
Show all versions of rsocket-core Show documentation
Core functionality for the RSocket library
The newest version!
package io.rsocket.frame;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator;
public class ResumeOkFrameCodec {
public static ByteBuf encode(final ByteBufAllocator allocator, long lastReceivedClientPos) {
ByteBuf byteBuf = FrameHeaderCodec.encodeStreamZero(allocator, FrameType.RESUME_OK, 0);
byteBuf.writeLong(lastReceivedClientPos);
return byteBuf;
}
public static long lastReceivedClientPos(ByteBuf byteBuf) {
FrameHeaderCodec.ensureFrameType(FrameType.RESUME_OK, byteBuf);
byteBuf.markReaderIndex();
long lastReceivedClientPosition = byteBuf.skipBytes(FrameHeaderCodec.size()).readLong();
byteBuf.resetReaderIndex();
return lastReceivedClientPosition;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy