Skip to content

Commit a03c04f

Browse files
committed
Clarify output byte order in ScalaDoc
1 parent f27e47f commit a03c04f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

core/src/main/scala/io/bullet/borer/Output.scala

+12
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,24 @@ trait Output { outer =>
2626
def writeBytes(a: Byte, b: Byte, c: Byte): Self
2727
def writeBytes(a: Byte, b: Byte, c: Byte, d: Byte): Self
2828

29+
/**
30+
* Writes the given 16-bit value to the output using NETWORK BYTE order (i.e. BIG ENDIAN),
31+
* independently of the platform's endianess.
32+
*/
2933
def writeShort(value: Short): Self =
3034
writeBytes((value >> 8).toByte, value.toByte)
3135

36+
/**
37+
* Writes the given 32-bit value to the output using NETWORK BYTE order (i.e. BIG ENDIAN),
38+
* independently of the platform's endianess.
39+
*/
3240
def writeInt(value: Int): Self =
3341
writeBytes((value >> 24).toByte, (value >> 16).toByte, (value >> 8).toByte, value.toByte)
3442

43+
/**
44+
* Writes the given 64-bit value to the output using NETWORK BYTE order (i.e. BIG ENDIAN),
45+
* independently of the platform's endianess.
46+
*/
3547
def writeLong(value: Long): Self =
3648
writeInt((value >> 32).toInt).writeInt(value.toInt).asInstanceOf[Self]
3749

0 commit comments

Comments
 (0)