3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-17 05:20:14 +01:00

Merge pull request #344 from alexstaeding/feature/pluginMessageEvent-dataAsInputStream

Add dataAsInputStream() to PluginMessageEvent
Dieser Commit ist enthalten in:
Andrew Steinborn 2020-08-03 11:37:02 -04:00 committet von GitHub
Commit 3b8f3ae960
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -9,6 +9,7 @@ import com.velocitypowered.api.proxy.ServerConnection;
import com.velocitypowered.api.proxy.messages.ChannelIdentifier; import com.velocitypowered.api.proxy.messages.ChannelIdentifier;
import com.velocitypowered.api.proxy.messages.ChannelMessageSink; import com.velocitypowered.api.proxy.messages.ChannelMessageSink;
import com.velocitypowered.api.proxy.messages.ChannelMessageSource; import com.velocitypowered.api.proxy.messages.ChannelMessageSource;
import java.io.ByteArrayInputStream;
import java.util.Arrays; import java.util.Arrays;
/** /**
@ -66,6 +67,10 @@ public final class PluginMessageEvent implements ResultedEvent<PluginMessageEven
return Arrays.copyOf(data, data.length); return Arrays.copyOf(data, data.length);
} }
public ByteArrayInputStream dataAsInputStream() {
return new ByteArrayInputStream(data);
}
public ByteArrayDataInput dataAsDataStream() { public ByteArrayDataInput dataAsDataStream() {
return ByteStreams.newDataInput(data); return ByteStreams.newDataInput(data);
} }