예제 #1
0
		String readStr() {
			VarInt varInt = new VarInt(bytes, cursor);
			if (varInt.value == 0) {
				cursor += 1;
				return "";
			}
			cursor += varInt.getSizeInBytes();
			byte[] characters = new byte[(int)varInt.value];
			bytes.CopyTo(cursor, characters, 0, characters.Length);
			cursor += characters.Length;
			return Encoding.UTF8.GetString(characters);
		}
예제 #2
0
		long readVarInt(int offset) {
			VarInt varint = new VarInt(bytes, cursor + offset);
			cursor += offset + varint.getSizeInBytes();
			return varint.value;
		}