Skip to content

Commit 3718dda

Browse files
committed
update Java version
1 parent 96ff8bd commit 3718dda

File tree

5 files changed

+509
-1090
lines changed

5 files changed

+509
-1090
lines changed

api/com.upokecenter.cbor.CBORObject.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4087,7 +4087,16 @@ Converts this object to a 32-bit floating point number.
40874087

40884088
### AsString
40894089
public java.lang.String AsString()
4090-
Gets the value of this object as a text string.
4090+
Gets the value of this object as a text string.<p>This method is not the
4091+
"reverse" of the <code>FromObject</code> method in the sense that
4092+
FromObject can take either a text string or <code>null</code>, but this
4093+
method can accept only text strings. The <code>ToObject</code> method is
4094+
closer to a "reverse" version to <code>FromObject</code> than the
4095+
<code>AsString</code> method: <code>ToObject&lt;string&gt;(cbor)</code> in
4096+
DotNet, or <code>ToObject(string.class)</code> in Java, will convert a
4097+
CBOR object to a DotNet or Java string if it represents a text
4098+
string, or to <code>null</code> if <code>IsNull</code> returns <code>true</code> for
4099+
the CBOR object, and will fail in other cases.</p>
40914100

40924101
**Returns:**
40934102

src/main/java/com/upokecenter/cbor/CBORObject.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7343,7 +7343,7 @@ private static void WriteStreamedString(String str, OutputStream stream) throws
73437343
bytes[byteIndex++] = (byte)c;
73447344
} else if (c <= 0x7ff) {
73457345
if (byteIndex + 2 > StreamedStringBufferLength) {
7346-
// Write bytes retrieved so far - the next three bytes
7346+
// Write bytes retrieved so far - the next two bytes
73477347
// would exceed the length, and the CBOR spec forbids
73487348
// splitting characters when generating text strings
73497349
if (!streaming) {

0 commit comments

Comments
 (0)