*/
public static List<MetadataMap.Entry> readMetadata(ByteBuf buf) throws IOException {
List<MetadataMap.Entry> entries = new ArrayList<>();
byte item;
while ((item = buf.readByte()) != 0x7F) {
MetadataType type = MetadataType.byId(item >> 5);
int id = item & 0x1f;
MetadataIndex index = MetadataIndex.getIndex(id, type);
switch (type) {
case BYTE: