More refactoring (tm)
This commit is contained in:
@@ -63,10 +63,10 @@ public class BufferedSource implements Runnable {
|
||||
garbageValue = "1727240458"
|
||||
)
|
||||
@Export("isAvailable")
|
||||
boolean isAvailable(int var1) throws IOException {
|
||||
if (var1 == 0) {
|
||||
boolean isAvailable(int length) throws IOException {
|
||||
if (length == 0) {
|
||||
return true;
|
||||
} else if (var1 > 0 && var1 < this.capacity) {
|
||||
} else if (length > 0 && length < this.capacity) {
|
||||
synchronized(this) {
|
||||
int var3;
|
||||
if (this.position <= this.limit) {
|
||||
@@ -75,7 +75,7 @@ public class BufferedSource implements Runnable {
|
||||
var3 = this.capacity - this.position + this.limit;
|
||||
}
|
||||
|
||||
if (var3 < var1) {
|
||||
if (var3 < length) {
|
||||
if (this.exception != null) {
|
||||
throw new IOException(this.exception.toString());
|
||||
} else {
|
||||
@@ -144,8 +144,8 @@ public class BufferedSource implements Runnable {
|
||||
garbageValue = "-37"
|
||||
)
|
||||
@Export("read")
|
||||
int read(byte[] var1, int var2, int var3) throws IOException {
|
||||
if (var3 >= 0 && var2 >= 0 && var3 + var2 <= var1.length) {
|
||||
int read(byte[] dst, int dstIndex, int length) throws IOException {
|
||||
if (length >= 0 && dstIndex >= 0 && length + dstIndex <= dst.length) {
|
||||
synchronized(this) {
|
||||
int var5;
|
||||
if (this.position <= this.limit) {
|
||||
@@ -154,24 +154,24 @@ public class BufferedSource implements Runnable {
|
||||
var5 = this.capacity - this.position + this.limit;
|
||||
}
|
||||
|
||||
if (var3 > var5) {
|
||||
var3 = var5;
|
||||
if (length > var5) {
|
||||
length = var5;
|
||||
}
|
||||
|
||||
if (var3 == 0 && this.exception != null) {
|
||||
if (length == 0 && this.exception != null) {
|
||||
throw new IOException(this.exception.toString());
|
||||
} else {
|
||||
if (var3 + this.position <= this.capacity) {
|
||||
System.arraycopy(this.buffer, this.position, var1, var2, var3);
|
||||
if (length + this.position <= this.capacity) {
|
||||
System.arraycopy(this.buffer, this.position, dst, dstIndex, length);
|
||||
} else {
|
||||
int var6 = this.capacity - this.position;
|
||||
System.arraycopy(this.buffer, this.position, var1, var2, var6);
|
||||
System.arraycopy(this.buffer, 0, var1, var6 + var2, var3 - var6);
|
||||
System.arraycopy(this.buffer, this.position, dst, dstIndex, var6);
|
||||
System.arraycopy(this.buffer, 0, dst, var6 + dstIndex, length - var6);
|
||||
}
|
||||
|
||||
this.position = (var3 + this.position) % this.capacity;
|
||||
this.position = (length + this.position) % this.capacity;
|
||||
this.notifyAll();
|
||||
return var3;
|
||||
return length;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user