IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
JarFileEntry.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Immutable;
3using System.IO;
4using System.IO.Compression;
5
6namespace IKVM.CoreLib.Jar
7{
8
12 internal readonly struct JarFileEntry
13 {
14
15 readonly JarFile _jar;
16 readonly ZipArchiveEntry _entry;
17 readonly string _name;
18 readonly int _versionFeature;
19
28 public JarFileEntry(JarFile jar, ZipArchiveEntry entry, string name, int versionFeature)
29 {
30 _jar = jar ?? throw new ArgumentNullException(nameof(jar));
31 _entry = entry ?? throw new ArgumentNullException(nameof(entry));
32 _name = name ?? throw new ArgumentNullException(nameof(name));
33 _versionFeature = versionFeature;
34 }
35
39 public readonly string Name => _name;
40
44 public readonly int VersionFeature => _versionFeature;
45
49 public readonly ImmutableDictionary<string, string> Attributes => _jar.Manifest is { } m && m.Attributes.TryGetValue(_entry.FullName, out var attr) ? attr : ImmutableDictionary<string, string>.Empty;
50
55 public readonly Stream Open() => _entry.Open();
56
57 }
58
59}
global::java.lang.invoke.LambdaForm.Name Name