diff options
| author | Manuel Amago <mamago@gmail.com> | 2019-09-08 15:12:16 +0100 |
|---|---|---|
| committer | Manuel Amago <mamago@gmail.com> | 2019-09-08 15:12:16 +0100 |
| commit | 5bf90d1008a7d40558740a7c863d7094b423424a (patch) | |
| tree | 60507add81163760379dfe10f7fe9fdecb11a0d2 /src/main/java/org/mamago/util/Cast.java | |
| parent | 980b7c9fa9a88f7ee3881a4a3c65015da068eb2c (diff) | |
| download | logging-master.tar.gz logging-master.zip | |
First steps, not actually fully functional yet (i.e. ring buffer is not
actually a ring buffer, and there is no log printer polling the other
side).
Diffstat (limited to 'src/main/java/org/mamago/util/Cast.java')
| -rw-r--r-- | src/main/java/org/mamago/util/Cast.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/org/mamago/util/Cast.java b/src/main/java/org/mamago/util/Cast.java new file mode 100644 index 0000000..4ed3d47 --- /dev/null +++ b/src/main/java/org/mamago/util/Cast.java @@ -0,0 +1,16 @@ +package org.mamago.util; + +public class Cast { + // Prevent instantiation + private Cast() {} + + public static byte asByte(int i) { + // @Fixme[MA]: check whether casting give out-of-bounds check, otherwise add in for safety + return (byte) i; + } + + public static short asShort(int i) { + // @Fixme[MA]: check whether casting give out-of-bounds check, otherwise add in for safety + return (byte) i; + } +} |
