File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
src/main/java/org/scijava/io Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -592,6 +592,12 @@ default void writeByte(final int v) throws IOException {
592592 write (v );
593593 }
594594
595+ @ Override
596+ default void writeShort (final int v ) throws IOException {
597+ write ((v >>> 8 ) & 0xFF );
598+ write ((v >>> 0 ) & 0xFF );
599+ }
600+
595601 @ Override
596602 default void writeChar (final int v ) throws IOException {
597603 write ((v >>> 8 ) & 0xFF );
@@ -633,6 +639,16 @@ default void writeBytes(final String s) throws IOException {
633639 write (s .getBytes ("UTF-8" ));
634640 }
635641
642+ @ Override
643+ default void writeChars (final String s ) throws IOException {
644+ final int len = s .length ();
645+ for (int i = 0 ; i < len ; i ++) {
646+ final int v = s .charAt (i );
647+ write ((v >>> 8 ) & 0xFF );
648+ write ((v >>> 0 ) & 0xFF );
649+ }
650+ }
651+
636652 @ Override
637653 default void writeUTF (final String str ) throws IOException {
638654 final byte [] b = str .getBytes ("UTF-8" );
You can’t perform that action at this time.
0 commit comments