FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
java-code-example/AbstractObjectChecker/src/PackObject.java at master · cherkavi/java-code-example · GitHub
cherkavi
/
java-code-example
Public
Notifications
You must be signed in to change notification settings
Fork
4
Star
0
Code
Issues
0
Pull requests
42
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
java-code-example
/
AbstractObjectChecker
/
src
/
PackObject.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
27 lines (25 loc) · 838 Bytes
Breadcrumbs
java-code-example
/
AbstractObjectChecker
/
src
/
PackObject.java
Copy path
File metadata and controls
executable file
·
27 lines (25 loc) · 838 Bytes
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
import
java
.
io
.
FileOutputStream
;
import
java
.
io
.
ObjectOutputStream
;
import
calc
.
AbstractChecker
;
import
calc_implementation
.
EQDoubleChecker
;
public
class
PackObject
{
public
static
void
main
(
String
[]
args
){
System
.
out
.
println
(
"begin"
);
AbstractChecker
checker
=
new
EQDoubleChecker
(
5000
,
" Double Alarm message "
,
1.2345d
,
5
);
writeObjectToFile
(
"c:
\\
out.bin"
,
checker
);
System
.
out
.
println
(
"end"
);
}
private
static
boolean
writeObjectToFile
(
String
pathToFile
,
Object
object
){
boolean
returnValue
=
false
;
try
{
ObjectOutputStream
fos
=
new
ObjectOutputStream
(
new
FileOutputStream
(
pathToFile
));
fos
.
writeObject
(
object
);
fos
.
flush
();
fos
.
close
();
return
true
;
}
catch
(
Exception
ex
){
System
.
err
.
println
(
"writeObjectToFile Exception: "
+
ex
.
getMessage
());
}
return
returnValue
;
}
}
Back
|
FazBrowse Home
|
New Git URL