File tree Expand file tree Collapse file tree 3 files changed +21
-3
lines changed
src/com/koushikdutta/async Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ android {
18
18
main {
19
19
manifest. srcFile ' AndroidManifest.xml'
20
20
21
- jniLibs. srcDirs = [' libs/' ]
21
+ // jniLibs.srcDirs = ['libs/']
22
22
23
23
java. srcDirs= [' src/'
24
24
// , 'okhttp/'
Original file line number Diff line number Diff line change @@ -83,7 +83,25 @@ public int remaining() {
83
83
public boolean hasRemaining () {
84
84
return remaining () > 0 ;
85
85
}
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
+
87
105
public int getInt () {
88
106
int ret = read (4 ).getInt ();
89
107
remaining -= 4 ;
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ public Future<String> parse(DataEmitter emitter) {
20
20
.then (new TransformFuture <String , ByteBufferList >() {
21
21
@ Override
22
22
protected void transform (ByteBufferList result ) throws Exception {
23
- setComplete (result .readString (Charset .forName (charset )));
23
+ setComplete (result .readString (charset != null ? Charset .forName (charset ) : null ));
24
24
}
25
25
});
26
26
}
You can’t perform that action at this time.
0 commit comments