Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Julien Cervelle
PadiFlac
Commits
d6ddb1fa
Commit
d6ddb1fa
authored
May 09, 2022
by
Julien Cervelle
Browse files
-
parent
fa9a065b
Pipeline
#2720
failed with stage
in 1 minute and 44 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
frontJava/src/frontJava/padiflac/Channel.java
View file @
d6ddb1fa
...
...
@@ -125,13 +125,17 @@ public class Channel<T> {
os
.
write
(
serializeToString
(
s
));
os
.
close
();
uc
.
connect
();
//byte[] result = uc.getInputStream().readAllBytes();
// result should be ['O','K','\n']
byte
[]
result
=
uc
.
getInputStream
().
readAllBytes
();
// result should be ['O','K'] = [79, 75]
if
(!
java
.
util
.
Arrays
.
equals
(
result
,
OK
))
{
throw
new
IOException
(
"Unexpected answer from server"
);
}
}
catch
(
MalformedURLException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
}
private
static
final
byte
[]
OK
=
{
'O'
,
'K'
};
static
class
Test
implements
Serializable
{
...
...
@@ -164,8 +168,8 @@ public class Channel<T> {
}
public
static
void
main
(
String
[]
args
)
throws
ClassNotFoundException
,
IOException
{
//
testObject();
testString
();
testObject
();
//
testString();
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment