Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Erik Jansson
LabComm
Commits
10bbd93d
Commit
10bbd93d
authored
Oct 14, 2014
by
Anders Blomdell
Browse files
Removed optional version preamble. Since we don't flatten
signatures in 20141009, this is not needed any more.
parent
9e33b043
Changes
4
Hide whitespace changes
Inline
Side-by-side
lib/csharp/se/lth/control/labcomm/EncoderChannel.cs
View file @
10bbd93d
...
...
@@ -13,17 +13,13 @@ namespace se.lth.control.labcomm {
byte
[]
buf
=
new
byte
[
8
];
private
int
current_tag
;
public
EncoderChannel
(
Stream
writer
,
bool
emitVersion
)
{
public
EncoderChannel
(
Stream
writer
)
{
this
.
writer
=
writer
;
if
(
emitVersion
)
{
encodeString
(
Constant
.
VERSION
);
bytes
.
WriteTo
(
writer
);
bytes
.
SetLength
(
0
);
writer
.
Flush
();
}
}
public
EncoderChannel
(
Stream
writer
)
:
this
(
writer
,
true
)
{
encodeString
(
Constant
.
VERSION
);
bytes
.
WriteTo
(
writer
);
bytes
.
SetLength
(
0
);
writer
.
Flush
();
}
public
void
register
(
SampleDispatcher
dispatcher
)
{
...
...
lib/java/se/lth/control/labcomm/EncoderChannel.java
View file @
10bbd93d
...
...
@@ -13,31 +13,20 @@ public class EncoderChannel implements Encoder {
private
EncoderRegistry
registry
;
private
int
current_tag
;
public
EncoderChannel
(
Writer
writer
,
boolean
emitVersion
)
throws
IOException
{
public
EncoderChannel
(
Writer
writer
)
throws
IOException
{
this
.
writer
=
writer
;
bytes
=
new
ByteArrayOutputStream
();
data
=
new
DataOutputStream
(
bytes
);
registry
=
new
EncoderRegistry
();
if
(
emitVersion
)
{
encodeString
(
Constant
.
VERSION
);
data
.
flush
();
writer
.
write
(
bytes
.
toByteArray
());
bytes
.
reset
();
}
}
public
EncoderChannel
(
Writer
writer
)
throws
IOException
{
this
(
writer
,
true
);
}
public
EncoderChannel
(
OutputStream
writer
,
boolean
emitVersion
)
throws
IOException
{
this
(
new
WriterWrapper
(
writer
),
emitVersion
);
encodeString
(
Constant
.
VERSION
);
data
.
flush
();
writer
.
write
(
bytes
.
toByteArray
());
bytes
.
reset
();
}
public
EncoderChannel
(
OutputStream
writer
)
throws
IOException
{
this
(
new
WriterWrapper
(
writer
)
,
true
);
this
(
new
WriterWrapper
(
writer
));
}
public
void
register
(
SampleDispatcher
dispatcher
)
throws
IOException
{
...
...
lib/java/se/lth/control/labcomm2006/DecoderChannel.java
View file @
10bbd93d
...
...
@@ -24,7 +24,7 @@ public class DecoderChannel implements Decoder {
int
index
=
decodePacked32
();
String
name
=
decodeString
();
ByteArrayOutputStream
signature
=
new
ByteArrayOutputStream
();
collectFlatSignature
(
new
EncoderChannel
(
signature
,
false
));
collectFlatSignature
(
new
EncoderChannel
(
signature
));
registry
.
add
(
index
,
name
,
signature
.
toByteArray
());
}
break
;
default
:
{
...
...
lib/java/se/lth/control/labcomm2006/EncoderChannel.java
View file @
10bbd93d
...
...
@@ -12,28 +12,15 @@ public class EncoderChannel implements Encoder {
private
DataOutputStream
data
;
private
EncoderRegistry
registry
;
public
EncoderChannel
(
Writer
writer
,
boolean
emitVersion
)
throws
IOException
{
public
EncoderChannel
(
Writer
writer
)
throws
IOException
{
this
.
writer
=
writer
;
bytes
=
new
ByteArrayOutputStream
();
data
=
new
DataOutputStream
(
bytes
);
registry
=
new
EncoderRegistry
();
if
(
emitVersion
)
{
throw
new
IllegalArgumentException
(
"Labcomm 2006 does not support emitVersion"
);
}
}
public
EncoderChannel
(
Writer
writer
)
throws
IOException
{
this
(
writer
,
false
);
}
public
EncoderChannel
(
OutputStream
writer
,
boolean
emitVersion
)
throws
IOException
{
this
(
new
WriterWrapper
(
writer
),
emitVersion
);
}
public
EncoderChannel
(
OutputStream
writer
)
throws
IOException
{
this
(
new
WriterWrapper
(
writer
)
,
false
);
this
(
new
WriterWrapper
(
writer
));
}
public
void
register
(
SampleDispatcher
dispatcher
)
throws
IOException
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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