forked from I2P_Developers/i2p.i2p
Cleanup: Don't use DataHelper.writeLong() for a single byte
This commit is contained in:
@ -430,7 +430,7 @@ public class DeliveryInstructions extends DataStructureImpl {
|
||||
// _log.debug("Write flags: " + flags + " mode: " + getDeliveryMode()
|
||||
// + " =?= " + flagMode(flags));
|
||||
byte additionalInfo[] = getAdditionalInfo();
|
||||
DataHelper.writeLong(out, 1, flags);
|
||||
out.write((byte) flags);
|
||||
if (additionalInfo != null) {
|
||||
out.write(additionalInfo);
|
||||
out.flush();
|
||||
|
@ -288,7 +288,7 @@ public class RouterAddress extends DataStructureImpl {
|
||||
public void writeBytes(OutputStream out) throws DataFormatException, IOException {
|
||||
if (_transportStyle == null)
|
||||
throw new DataFormatException("uninitialized");
|
||||
DataHelper.writeLong(out, 1, _cost);
|
||||
out.write((byte) _cost);
|
||||
DataHelper.writeLong(out, 8, _expiration);
|
||||
DataHelper.writeString(out, _transportStyle);
|
||||
DataHelper.writeProperties(out, _options);
|
||||
|
@ -243,7 +243,7 @@ public class GarlicMessageBuilder {
|
||||
if (config instanceof PayloadGarlicConfig) {
|
||||
byte clove[] = buildClove(ctx, (PayloadGarlicConfig)config);
|
||||
baos = new ByteArrayOutputStream(clove.length + 16);
|
||||
DataHelper.writeLong(baos, 1, 1);
|
||||
baos.write((byte) 1);
|
||||
baos.write(clove);
|
||||
} else {
|
||||
byte cloves[][] = new byte[config.getCloveCount()][];
|
||||
@ -263,7 +263,7 @@ public class GarlicMessageBuilder {
|
||||
for (int i = 0; i < cloves.length; i++)
|
||||
len += cloves[i].length;
|
||||
baos = new ByteArrayOutputStream(len + 16);
|
||||
DataHelper.writeLong(baos, 1, cloves.length);
|
||||
baos.write((byte) cloves.length);
|
||||
for (int i = 0; i < cloves.length; i++)
|
||||
baos.write(cloves[i]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user