Move pregenerated bytecode to resource folder

This commit is contained in:
Taro L. Saito 2011-06-23 22:36:55 +09:00
parent 4ee2936297
commit 8504a9384d
4 changed files with 3 additions and 1 deletions

View File

@ -24,6 +24,7 @@
<resource>
<directory>src/main/resources</directory>
<includes>
<include>org/xerial/snappy/*.bytecode</include>
<include>org/xerial/snappy/native/**</include>
</includes>
</resource>

View File

@ -95,7 +95,8 @@ public class SnappyLoader
private static byte[] getByteCode(String resourcePath) throws IOException {
InputStream in = SnappyLoader.class.getResourceAsStream(resourcePath);
assert (in != null);
if (in == null)
throw new IOException(resourcePath + " is not found");
byte[] buf = new byte[1024];
ByteArrayOutputStream byteCodeBuf = new ByteArrayOutputStream();
for (int readLength; (readLength = in.read(buf)) != -1;) {