Skip to content

Add unsigned numbers extensions.#1779

Merged
swankjesse merged 4 commits into
square:masterfrom
MohammedKHC:unsigned
Jun 23, 2026
Merged

Add unsigned numbers extensions.#1779
swankjesse merged 4 commits into
square:masterfrom
MohammedKHC:unsigned

Conversation

@MohammedKHC

Copy link
Copy Markdown
Contributor

Closes #513

@MohammedKHC

Copy link
Copy Markdown
Contributor Author

Sorry I forgot to run ./gradlew apiDump.

Comment thread okio/api/okio.api
Comment on lines +54 to +60
public static final fun writeUByte-EK-6454 (Lokio/BufferedSink;B)Lokio/BufferedSink;
public static final fun writeUInt-Qn1smSk (Lokio/BufferedSink;I)Lokio/BufferedSink;
public static final fun writeUIntLe-Qn1smSk (Lokio/BufferedSink;I)Lokio/BufferedSink;
public static final fun writeULong-2TYgG_w (Lokio/BufferedSink;J)Lokio/BufferedSink;
public static final fun writeULongLe-2TYgG_w (Lokio/BufferedSink;J)Lokio/BufferedSink;
public static final fun writeUShort-i8woANY (Lokio/BufferedSink;S)Lokio/BufferedSink;
public static final fun writeUShortLe-i8woANY (Lokio/BufferedSink;S)Lokio/BufferedSink;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use @JvmName for these methods??
I don't think that the api should contain this..
Or is this alright??

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mangling seems to be stable
https://kotlinlang.org/docs/inline-classes.html#mangling

functions using inline classes are mangled by adding some stable hashcode to the function name.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole type is already invisible to Java due to the hyphen. Otherwise this is public API we have to track.

MohammedKHC and others added 2 commits April 24, 2026 04:20
Co-authored-by: Brian Norman <brian_norman@atavium.com>
}

/**
* Writes a big-endian, unsigned int to this sink using four bytes.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These docs are perfect

Comment thread okio/src/commonMain/kotlin/okio/Unsigned.kt Outdated
Comment thread okio/src/commonMain/kotlin/okio/Unsigned.kt Outdated
MohammedKHC and others added 2 commits June 18, 2026 19:32
@swankjesse swankjesse merged commit d1fc3f6 into square:master Jun 23, 2026
14 checks passed
@MohammedKHC MohammedKHC deleted the unsigned branch June 23, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BufferedSource.readUByte etc.

3 participants