Skip to content

Commit

Permalink
Tune visibility of private methods of writer API
Browse files Browse the repository at this point in the history
  • Loading branch information
plokhotnyuk committed Apr 1, 2018
1 parent 9cd54ad commit 3e382cf
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -361,42 +361,42 @@ final class JsonWriter private[jsoniter_scala](
} finally this.buf = currBuf
}

private def writeNestedStart(b: Byte): Unit = {
private[this] def writeNestedStart(b: Byte): Unit = {
indention += config.indentionStep
comma = false
writeBytes(b)
}

private def writeNestedEnd(b: Byte): Unit = {
private[this] def writeNestedEnd(b: Byte): Unit = {
val indentionStep = config.indentionStep
writeIndention(indentionStep)
indention -= indentionStep
comma = true
writeBytes(b)
}

private def writeBytes(b: Byte): Unit = count = {
private[this] def writeBytes(b: Byte): Unit = count = {
val pos = ensureBufCapacity(1)
buf(pos) = b
pos + 1
}

private def writeBytes(b1: Byte, b2: Byte): Unit = count = {
private[this] def writeBytes(b1: Byte, b2: Byte): Unit = count = {
val pos = ensureBufCapacity(2)
buf(pos) = b1
buf(pos + 1) = b2
pos + 2
}

private def writeBytes(b1: Byte, b2: Byte, b3: Byte): Unit = count = {
private[this] def writeBytes(b1: Byte, b2: Byte, b3: Byte): Unit = count = {
val pos = ensureBufCapacity(3)
buf(pos) = b1
buf(pos + 1) = b2
buf(pos + 2) = b3
pos + 3
}

private def writeBytes(b1: Byte, b2: Byte, b3: Byte, b4: Byte): Unit = count = {
private[this] def writeBytes(b1: Byte, b2: Byte, b3: Byte, b4: Byte): Unit = count = {
val pos = ensureBufCapacity(4)
buf(pos) = b1
buf(pos + 1) = b2
Expand All @@ -405,7 +405,7 @@ final class JsonWriter private[jsoniter_scala](
pos + 4
}

private def writeBytes(b1: Byte, b2: Byte, b3: Byte, b4: Byte, b5: Byte): Unit = count = {
private[this] def writeBytes(b1: Byte, b2: Byte, b3: Byte, b4: Byte, b5: Byte): Unit = count = {
val pos = ensureBufCapacity(5)
buf(pos) = b1
buf(pos + 1) = b2
Expand All @@ -415,7 +415,7 @@ final class JsonWriter private[jsoniter_scala](
pos + 5
}

private def writeBytes(b1: Byte, b2: Byte, b3: Byte, b4: Byte, b5: Byte, b6: Byte): Unit = count = {
private[this] def writeBytes(b1: Byte, b2: Byte, b3: Byte, b4: Byte, b5: Byte, b6: Byte): Unit = count = {
val pos = ensureBufCapacity(6)
buf(pos) = b1
buf(pos + 1) = b2
Expand All @@ -426,7 +426,7 @@ final class JsonWriter private[jsoniter_scala](
pos + 6
}

private def writeBytes(b1: Byte, b2: Byte, b3: Byte, b4: Byte, b5: Byte, b6: Byte, b7: Byte): Unit = count = {
private[this] def writeBytes(b1: Byte, b2: Byte, b3: Byte, b4: Byte, b5: Byte, b6: Byte, b7: Byte): Unit = count = {
val pos = ensureBufCapacity(7)
buf(pos) = b1
buf(pos + 1) = b2
Expand All @@ -438,7 +438,7 @@ final class JsonWriter private[jsoniter_scala](
pos + 7
}

private def writeNonEscapedAsciiStringWithoutParentheses(s: String): Unit = count = {
private[this] def writeNonEscapedAsciiStringWithoutParentheses(s: String): Unit = count = {
val len = s.length
val pos = ensureBufCapacity(len)
s.getBytes(0, len, buf, pos)
Expand Down

0 comments on commit 3e382cf

Please sign in to comment.