@@ -39,10 +39,10 @@ public void testDump() throws IOException {
3939 ByteArrayOutputStream stream = new ByteArrayOutputStream ();
4040
4141 HexDump .dump (testArray , 0 , stream , 0 );
42- byte [] outputArray = new byte [16 * (73 + HexDump . EOL .length ())];
42+ byte [] outputArray = new byte [16 * (73 + System . lineSeparator () .length ())];
4343
4444 for (int j = 0 ; j < 16 ; j ++) {
45- int offset = (73 + HexDump . EOL .length ()) * j ;
45+ int offset = (73 + System . lineSeparator () .length ()) * j ;
4646
4747 outputArray [offset ++] = (byte ) '0' ;
4848 outputArray [offset ++] = (byte ) '0' ;
@@ -61,7 +61,7 @@ public void testDump() throws IOException {
6161 for (int k = 0 ; k < 16 ; k ++) {
6262 outputArray [offset ++] = (byte ) toAscii (j * 16 + k );
6363 }
64- System .arraycopy (HexDump . EOL .getBytes (), 0 , outputArray , offset , HexDump . EOL .getBytes ().length );
64+ System .arraycopy (System . lineSeparator () .getBytes (), 0 , outputArray , offset , System . lineSeparator () .getBytes ().length );
6565 }
6666 byte [] actualOutput = stream .toByteArray ();
6767
@@ -73,9 +73,9 @@ public void testDump() throws IOException {
7373 // verify proper behavior with non-zero offset
7474 stream = new ByteArrayOutputStream ();
7575 HexDump .dump (testArray , 0x10000000 , stream , 0 );
76- outputArray = new byte [16 * (73 + HexDump . EOL .length ())];
76+ outputArray = new byte [16 * (73 + System . lineSeparator () .length ())];
7777 for (int j = 0 ; j < 16 ; j ++) {
78- int offset = (73 + HexDump . EOL .length ()) * j ;
78+ int offset = (73 + System . lineSeparator () .length ()) * j ;
7979
8080 outputArray [offset ++] = (byte ) '1' ;
8181 outputArray [offset ++] = (byte ) '0' ;
@@ -94,8 +94,8 @@ public void testDump() throws IOException {
9494 for (int k = 0 ; k < 16 ; k ++) {
9595 outputArray [offset ++] = (byte ) toAscii (j * 16 + k );
9696 }
97- System .arraycopy (HexDump . EOL .getBytes (), 0 , outputArray , offset ,
98- HexDump . EOL .getBytes ().length );
97+ System .arraycopy (System . lineSeparator () .getBytes (), 0 , outputArray , offset ,
98+ System . lineSeparator () .getBytes ().length );
9999 }
100100 actualOutput = stream .toByteArray ();
101101 assertEquals (outputArray .length , actualOutput .length , "array size mismatch" );
@@ -106,9 +106,9 @@ public void testDump() throws IOException {
106106 // verify proper behavior with negative offset
107107 stream = new ByteArrayOutputStream ();
108108 HexDump .dump (testArray , 0xFF000000 , stream , 0 );
109- outputArray = new byte [16 * (73 + HexDump . EOL .length ())];
109+ outputArray = new byte [16 * (73 + System . lineSeparator () .length ())];
110110 for (int j = 0 ; j < 16 ; j ++) {
111- int offset = (73 + HexDump . EOL .length ()) * j ;
111+ int offset = (73 + System . lineSeparator () .length ()) * j ;
112112
113113 outputArray [offset ++] = (byte ) 'F' ;
114114 outputArray [offset ++] = (byte ) 'F' ;
@@ -127,8 +127,8 @@ public void testDump() throws IOException {
127127 for (int k = 0 ; k < 16 ; k ++) {
128128 outputArray [offset ++] = (byte ) toAscii (j * 16 + k );
129129 }
130- System .arraycopy (HexDump . EOL .getBytes (), 0 , outputArray , offset ,
131- HexDump . EOL .getBytes ().length );
130+ System .arraycopy (System . lineSeparator () .getBytes (), 0 , outputArray , offset ,
131+ System . lineSeparator () .getBytes ().length );
132132 }
133133 actualOutput = stream .toByteArray ();
134134 assertEquals (outputArray .length , actualOutput .length , "array size mismatch" );
@@ -139,9 +139,9 @@ public void testDump() throws IOException {
139139 // verify proper behavior with non-zero index
140140 stream = new ByteArrayOutputStream ();
141141 HexDump .dump (testArray , 0x10000000 , stream , 0x81 );
142- outputArray = new byte [8 * (73 + HexDump . EOL .length ()) - 1 ];
142+ outputArray = new byte [8 * (73 + System . lineSeparator () .length ()) - 1 ];
143143 for (int j = 0 ; j < 8 ; j ++) {
144- int offset = (73 + HexDump . EOL .length ()) * j ;
144+ int offset = (73 + System . lineSeparator () .length ()) * j ;
145145
146146 outputArray [offset ++] = (byte ) '1' ;
147147 outputArray [offset ++] = (byte ) '0' ;
@@ -171,8 +171,8 @@ public void testDump() throws IOException {
171171 outputArray [offset ++] = (byte ) toAscii (index );
172172 }
173173 }
174- System .arraycopy (HexDump . EOL .getBytes (), 0 , outputArray , offset ,
175- HexDump . EOL .getBytes ().length );
174+ System .arraycopy (System . lineSeparator () .getBytes (), 0 , outputArray , offset ,
175+ System . lineSeparator () .getBytes ().length );
176176 }
177177 actualOutput = stream .toByteArray ();
178178 assertEquals (outputArray .length , actualOutput .length , "array size mismatch" );
0 commit comments