mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-08-28 00:12:16 +00:00
Fix issues with building with Java 9+
Fix for NoSuchMethodError when using Java 9+ at build time and Java 8 at runtime. Fixes #14
This commit is contained in:
parent
9967dc5740
commit
06092cfddd
@ -14,6 +14,7 @@ import javax.annotation.Nonnull;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.channels.ReadableByteChannel;
|
||||
import java.nio.channels.SeekableByteChannel;
|
||||
@ -124,7 +125,7 @@ public class BinaryReadableHandle extends HandleGeneric
|
||||
}
|
||||
else
|
||||
{
|
||||
single.clear();
|
||||
((Buffer) single).clear();
|
||||
int b = m_reader.read( single );
|
||||
return b == -1 ? null : new Object[] { single.get( 0 ) & 0xFF };
|
||||
}
|
||||
@ -148,7 +149,7 @@ public class BinaryReadableHandle extends HandleGeneric
|
||||
boolean readAnything = false;
|
||||
while( true )
|
||||
{
|
||||
buf.clear();
|
||||
((Buffer) buf).clear();
|
||||
int r = m_reader.read( buf );
|
||||
if( r == -1 ) break;
|
||||
|
||||
@ -172,7 +173,7 @@ public class BinaryReadableHandle extends HandleGeneric
|
||||
boolean readAnything = false, readRc = false;
|
||||
while( true )
|
||||
{
|
||||
single.clear();
|
||||
((Buffer) single).clear();
|
||||
int read = m_reader.read( single );
|
||||
if( read <= 0 )
|
||||
{
|
||||
|
@ -15,6 +15,7 @@ import dan200.computercraft.shared.util.StringUtil;
|
||||
import javax.annotation.Nonnull;
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.channels.FileChannel;
|
||||
import java.nio.channels.SeekableByteChannel;
|
||||
@ -60,7 +61,7 @@ public class BinaryWritableHandle extends HandleGeneric
|
||||
if( args.length > 0 && args[0] instanceof Number )
|
||||
{
|
||||
int number = ((Number) args[0]).intValue();
|
||||
single.clear();
|
||||
((Buffer) single).clear();
|
||||
single.put( (byte) number );
|
||||
single.flip();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user