FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
java/src/test/java/com/jsoniter/TestIO.java at master · ws-php/java · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
ws-php
/
java
Public
forked from
json-iterator/java
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
java
/
src
/
test
/
java
/
com
/
jsoniter
/
TestIO.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
36 lines (29 loc) · 1.15 KB
Breadcrumbs
java
/
src
/
test
/
java
/
com
/
jsoniter
/
TestIO.java
Copy path
File metadata and controls
36 lines (29 loc) · 1.15 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package
com
.
jsoniter
;
import
junit
.
framework
.
TestCase
;
import
java
.
io
.
ByteArrayInputStream
;
import
java
.
io
.
IOException
;
public
class
TestIO
extends
TestCase
{
public
void
test_read_byte
()
throws
IOException
{
JsonIterator
iter
=
JsonIterator
.
parse
(
new
ByteArrayInputStream
(
"1"
.
getBytes
()),
4096
);
assertEquals
(
'1'
,
iter
.
readByte
());
assertEquals
(
0
,
iter
.
readByte
());
assertTrue
(
iter
.
eof
);
}
public
void
test_read_bytes
()
throws
IOException
{
JsonIterator
iter
=
JsonIterator
.
parse
(
new
ByteArrayInputStream
(
"12"
.
getBytes
()),
4096
);
assertEquals
(
'1'
,
iter
.
readByte
());
assertEquals
(
'2'
,
iter
.
readByte
());
assertEquals
(
0
,
iter
.
readByte
());
assertTrue
(
iter
.
eof
);
}
public
void
test_unread_byte
()
throws
IOException
{
JsonIterator
iter
=
JsonIterator
.
parse
(
new
ByteArrayInputStream
(
"12"
.
getBytes
()),
4096
);
assertEquals
(
'1'
,
iter
.
readByte
());
assertEquals
(
'2'
,
iter
.
readByte
());
iter
.
unreadByte
();
assertEquals
(
'2'
,
iter
.
readByte
());
iter
.
unreadByte
();
iter
.
unreadByte
();
assertEquals
(
'1'
,
iter
.
readByte
());
}
}
Back
|
FazBrowse Home
|
New Git URL