Merge pull request #1002 from Jonatino/patch-1
cache: Cast ByteBuffer to Buffer to avoid compilation error with jdk 1.8u211
This commit is contained in:
@@ -27,6 +27,7 @@ package net.runelite.cache.io;
|
|||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.nio.Buffer;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
|
||||||
public final class OutputStream extends java.io.OutputStream
|
public final class OutputStream extends java.io.OutputStream
|
||||||
@@ -56,7 +57,7 @@ public final class OutputStream extends java.io.OutputStream
|
|||||||
int newCapacity = buffer.capacity() * 2;
|
int newCapacity = buffer.capacity() * 2;
|
||||||
|
|
||||||
ByteBuffer old = buffer;
|
ByteBuffer old = buffer;
|
||||||
old.flip();
|
((Buffer) old).flip();
|
||||||
|
|
||||||
buffer = ByteBuffer.allocate(newCapacity);
|
buffer = ByteBuffer.allocate(newCapacity);
|
||||||
|
|
||||||
@@ -196,7 +197,7 @@ public final class OutputStream extends java.io.OutputStream
|
|||||||
|
|
||||||
public byte[] flip()
|
public byte[] flip()
|
||||||
{
|
{
|
||||||
buffer.flip();
|
((Buffer) buffer).flip();
|
||||||
byte[] b = new byte[buffer.limit()];
|
byte[] b = new byte[buffer.limit()];
|
||||||
buffer.get(b);
|
buffer.get(b);
|
||||||
return b;
|
return b;
|
||||||
|
|||||||
Reference in New Issue
Block a user