Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
SquirrelJME
Commits
4ee6a8b2
Commit
4ee6a8b2
authored
Apr 10, 2022
by
Stephanie Gawroriski
Browse files
Add offset initializer to RawJarPackageBracketInputStream.
parent
4d66efaf
Pipeline
#100925
passed with stages
in 5 minutes and 23 seconds
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/RawJarPackageBracketInputStream.java
View file @
4ee6a8b2
...
@@ -46,6 +46,24 @@ public class RawJarPackageBracketInputStream
...
@@ -46,6 +46,24 @@ public class RawJarPackageBracketInputStream
*/
*/
public
RawJarPackageBracketInputStream
(
JarPackageBracket
__jar
)
public
RawJarPackageBracketInputStream
(
JarPackageBracket
__jar
)
throws
IOException
,
NullPointerException
throws
IOException
,
NullPointerException
{
this
(
__jar
,
0
);
}
/**
* Initializes the input stream to read the raw JAR.
*
* @param __jar The JAR to read raw data from.
* @param __offset The initial read offset.
* @throws IndexOutOfBoundsException If the offset is out of bounds.
* @throws IOException If reading from the given JAR in its
* raw data form is not possible.
* @throws NullPointerException On null arguments.
* @since 2022/04/09
*/
public
RawJarPackageBracketInputStream
(
JarPackageBracket
__jar
,
int
__offset
)
throws
IndexOutOfBoundsException
,
IOException
,
NullPointerException
{
{
if
(
__jar
==
null
)
if
(
__jar
==
null
)
throw
new
NullPointerException
(
"NARG"
);
throw
new
NullPointerException
(
"NARG"
);
...
@@ -57,9 +75,14 @@ public class RawJarPackageBracketInputStream
...
@@ -57,9 +75,14 @@ public class RawJarPackageBracketInputStream
throw
new
IOException
(
"ZZ3u "
+
throw
new
IOException
(
"ZZ3u "
+
JarPackageShelf
.
libraryPath
(
__jar
));
JarPackageShelf
.
libraryPath
(
__jar
));
// {@squirreljme.error ZZ4j Invalid offset into direct JAR.}
if
(
__offset
<
0
||
__offset
>
jarSize
)
throw
new
IndexOutOfBoundsException
(
"ZZ4j"
);
// Set for later
// Set for later
this
.
jar
=
__jar
;
this
.
jar
=
__jar
;
this
.
jarSize
=
jarSize
;
this
.
jarSize
=
jarSize
;
this
.
_readPos
=
__offset
;
}
}
/**
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment