Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
</licenses>

<properties>
<maven.compiler.release>21</maven.compiler.release>
<!-- The shipped library targets Java 8 so it can be consumed by SDKs
on that floor (e.g. 51Degrees pipeline-java). Test sources use
newer language features and are compiled at a modern release
below; tests are not shipped. -->
<maven.compiler.release>8</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.version>5.10.2</junit.version>
</properties>
Expand All @@ -41,6 +45,17 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<executions>
<!-- Main sources ship at Java 8 (see maven.compiler.release).
Test sources use newer language features, so compile
them at a modern release. -->
<execution>
<id>default-testCompile</id>
<configuration>
<release>17</release>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/swancommunity/owid/Io.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ static void writeString(ByteArrayOutputStream buffer, String value)
throw new OwidException("domain '" + value + "' is not valid");
}
}
buffer.writeBytes(bytes);
buffer.write(bytes, 0, bytes.length);
buffer.write(0);
}

Expand All @@ -198,7 +198,7 @@ static void writeByteArray(ByteArrayOutputStream buffer, byte[] value)
+ "' exceeds the unsigned 32 bit limit");
}
writeUInt32(buffer, value.length);
buffer.writeBytes(value);
buffer.write(value, 0, value.length);
}

/** Writes the fixed length signature, validating the length. */
Expand All @@ -207,7 +207,7 @@ static void writeSignature(ByteArrayOutputStream buffer, byte[] value)
if (value.length != Owid.SIGNATURE_LENGTH) {
throw invalidSignatureLength(value.length);
}
buffer.writeBytes(value);
buffer.write(value, 0, value.length);
}

/** Writes the date using the encoding associated with the version. */
Expand Down