Skip to content

Commit c39cfbe

Browse files
committed
derp.
1 parent 9473c0e commit c39cfbe

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

AndroidAsync/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ android {
1818
main {
1919
manifest.srcFile 'AndroidManifest.xml'
2020

21-
jniLibs.srcDirs = ['libs/']
21+
// jniLibs.srcDirs = ['libs/']
2222

2323
java.srcDirs=['src/'
2424
// , 'okhttp/'

AndroidAsync/src/com/koushikdutta/async/ByteBufferList.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,25 @@ public int remaining() {
8383
public boolean hasRemaining() {
8484
return remaining() > 0;
8585
}
86-
86+
87+
public short peekShort() {
88+
return read(2).duplicate().getShort();
89+
}
90+
91+
public int peekInt() {
92+
return read(4).duplicate().getInt();
93+
}
94+
95+
public long peekLong() {
96+
return read(8).duplicate().getLong();
97+
}
98+
99+
public byte[] peekBytes(int size) {
100+
byte[] ret = new byte[size];
101+
read(size).duplicate().get(ret);
102+
return ret;
103+
}
104+
87105
public int getInt() {
88106
int ret = read(4).getInt();
89107
remaining -= 4;

AndroidAsync/src/com/koushikdutta/async/parser/StringParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public Future<String> parse(DataEmitter emitter) {
2020
.then(new TransformFuture<String, ByteBufferList>() {
2121
@Override
2222
protected void transform(ByteBufferList result) throws Exception {
23-
setComplete(result.readString(Charset.forName(charset)));
23+
setComplete(result.readString(charset != null ? Charset.forName(charset) : null));
2424
}
2525
});
2626
}

0 commit comments

Comments
 (0)