Home / Function/ codeLengthBytes() — spring-boot Function Reference

codeLengthBytes() — spring-boot Function Reference

Architecture documentation for the codeLengthBytes() function in PemPrivateKeyParser.java from the spring-boot codebase.

Function java GradlePlugin RunTasks calls 1 called by 4

Entity Profile

Dependency Diagram

graph TD
  39052fdc_f98f_e2d5_90a5_578273efccfd["codeLengthBytes()"]
  e3e26f97_110a_1a9a_b87f_2c4111e4797e["objectIdentifier()"]
  e3e26f97_110a_1a9a_b87f_2c4111e4797e -->|calls| 39052fdc_f98f_e2d5_90a5_578273efccfd
  516ce615_3b70_0efc_5ae3_a3cd320e701c["integer()"]
  516ce615_3b70_0efc_5ae3_a3cd320e701c -->|calls| 39052fdc_f98f_e2d5_90a5_578273efccfd
  f04f2aa0_df4b_514a_38b4_f8285b1ccb71["octetString()"]
  f04f2aa0_df4b_514a_38b4_f8285b1ccb71 -->|calls| 39052fdc_f98f_e2d5_90a5_578273efccfd
  a78bd132_620d_5d6d_a1e9_30244685a2a6["sequence()"]
  a78bd132_620d_5d6d_a1e9_30244685a2a6 -->|calls| 39052fdc_f98f_e2d5_90a5_578273efccfd
  22300bf1_ea98_babd_bb65_c4291ee0698a["toByteArray()"]
  39052fdc_f98f_e2d5_90a5_578273efccfd -->|calls| 22300bf1_ea98_babd_bb65_c4291ee0698a
  style 39052fdc_f98f_e2d5_90a5_578273efccfd fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

core/spring-boot/src/main/java/org/springframework/boot/ssl/pem/PemPrivateKeyParser.java lines 300–321

		void codeLengthBytes(int code, byte @Nullable [] bytes) throws IOException {
			this.stream.write(code);
			int length = (bytes != null) ? bytes.length : 0;
			if (length <= 127) {
				this.stream.write(length & 0xFF);
			}
			else {
				ByteArrayOutputStream lengthStream = new ByteArrayOutputStream();
				while (length != 0) {
					lengthStream.write(length & 0xFF);
					length = length >> 8;
				}
				byte[] lengthBytes = lengthStream.toByteArray();
				this.stream.write(0x80 | lengthBytes.length);
				for (int i = lengthBytes.length - 1; i >= 0; i--) {
					this.stream.write(lengthBytes[i]);
				}
			}
			if (bytes != null) {
				this.stream.write(bytes);
			}
		}

Domain

Subdomains

Called By

Frequently Asked Questions

What does codeLengthBytes() do?
codeLengthBytes() is a function in the spring-boot codebase.
What does codeLengthBytes() call?
codeLengthBytes() calls 1 function(s): toByteArray.
What calls codeLengthBytes()?
codeLengthBytes() is called by 4 function(s): integer, objectIdentifier, octetString, sequence.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free