Package dev.lavalink.youtube.sabr
Class UmpReader
java.lang.Object
dev.lavalink.youtube.sabr.UmpReader
Parser for YouTube's UMP (Universal/Ultra Media Playback) container format, which wraps
SABR streaming responses. A UMP payload is a sequence of parts, each encoded as
[varint partType][varint partSize][partSize bytes of data].
Note: UMP uses its own variable-length integer encoding which differs from the LEB128 varint used by protocol buffers. The number of bytes is derived from the high bits of the first byte, and the value is little-endian.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidread(@NotNull UmpReader.PartHandler handler) Reads every complete part from the buffer, invoking the handler for each.
-
Field Details
-
MEDIA_HEADER
public static final int MEDIA_HEADER- See Also:
-
MEDIA
public static final int MEDIA- See Also:
-
MEDIA_END
public static final int MEDIA_END- See Also:
-
NEXT_REQUEST_POLICY
public static final int NEXT_REQUEST_POLICY- See Also:
-
FORMAT_INITIALIZATION_METADATA
public static final int FORMAT_INITIALIZATION_METADATA- See Also:
-
SABR_REDIRECT
public static final int SABR_REDIRECT- See Also:
-
SABR_ERROR
public static final int SABR_ERROR- See Also:
-
RELOAD_PLAYER_RESPONSE
public static final int RELOAD_PLAYER_RESPONSE- See Also:
-
SABR_CONTEXT_UPDATE
public static final int SABR_CONTEXT_UPDATE- See Also:
-
STREAM_PROTECTION_STATUS
public static final int STREAM_PROTECTION_STATUS- See Also:
-
SABR_CONTEXT_SENDING_POLICY
public static final int SABR_CONTEXT_SENDING_POLICY- See Also:
-
-
Constructor Details
-
UmpReader
public UmpReader(@NotNull @org.jetbrains.annotations.NotNull byte[] data)
-
-
Method Details
-
read
Reads every complete part from the buffer, invoking the handler for each.- Throws:
Exception
-