Class ProtoWriter
java.lang.Object
dev.lavalink.youtube.sabr.protobuf.ProtoWriter
A minimal protocol buffers (proto2/proto3 wire-compatible) encoder.
Only the subset of functionality required to build SABR requests is implemented.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@org.jetbrains.annotations.NotNull byte[]@NotNull ProtoWriterwriteBool(int field, boolean value) @NotNull ProtoWriterwriteBytes(int field, @org.jetbrains.annotations.NotNull byte[] value) @NotNull ProtoWriterwriteFloat(int field, float value) @NotNull ProtoWriterwriteMessage(int field, @NotNull ProtoWriter message) Writes a nested message as a length-delimited field.@NotNull ProtoWriterwriteSInt(int field, long value) @NotNull ProtoWriterwriteString(int field, @NotNull String value) @NotNull ProtoWriterwriteVarint(int field, long value)
-
Constructor Details
-
ProtoWriter
public ProtoWriter()
-
-
Method Details
-
writeVarint
-
writeBool
-
writeSInt
-
writeFloat
-
writeBytes
@NotNull public @NotNull ProtoWriter writeBytes(int field, @NotNull @org.jetbrains.annotations.NotNull byte[] value) -
writeString
-
writeMessage
Writes a nested message as a length-delimited field. -
toByteArray
@NotNull public @org.jetbrains.annotations.NotNull byte[] toByteArray()
-