com.google.protobuf.ZeroCopy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of clarity-protobuf Show documentation
Show all versions of clarity-protobuf Show documentation
Clarity is an open source replay parser for Dota 2 and CSGO 1 and 2 written in Java. This JAR contains the protobuf classes for clarity.
package com.google.protobuf;
public final class ZeroCopy {
public static ByteString wrap(final byte[] array) {
return new LiteralByteString(array);
}
public static ByteString wrapBounded(final byte[] array, int offset, int length) {
return new BoundedByteString(array, offset, length);
}
public static byte[] extract(final ByteString buf) {
if (buf instanceof LiteralByteString) {
return ((LiteralByteString) buf).bytes;
}
throw new UnsupportedOperationException("Need a LiteralByteString, got a " + buf.getClass().getName());
}
}