Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 32 for toByteArray (0.32 sec)

  1. src/test/java/org/codelibs/core/io/CopyUtilTest.java

        /**
         * @throws Exception
         */
        @Test
        public void testIsToOs() throws Exception {
            final int result = copy(is, os);
            assertThat(result, is(srcBytes.length));
            assertThat(os.toByteArray(), is(srcBytes));
        }
    
        /**
         * @throws Exception
         */
        @Test
        public void testReaderToWriter() throws Exception {
            final int result = copy(reader, writer);
    Java
    - Registered: Fri May 03 20:58:11 GMT 2024
    - Last Modified: Thu Mar 07 01:59:08 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/primitives/ShortsTest.java

            .isEqualTo(new short[] {(short) 1, (short) 2, (short) 3, (short) 4});
      }
    
      @GwtIncompatible // Shorts.toByteArray
      public void testToByteArray() {
        assertThat(Shorts.toByteArray((short) 0x2345)).isEqualTo(new byte[] {0x23, 0x45});
        assertThat(Shorts.toByteArray((short) 0xFEDC)).isEqualTo(new byte[] {(byte) 0xFE, (byte) 0xDC});
      }
    
      @GwtIncompatible // Shorts.fromByteArray
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 29 15:43:06 GMT 2024
    - 26.6K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/primitives/ShortsTest.java

            .isEqualTo(new short[] {(short) 1, (short) 2, (short) 3, (short) 4});
      }
    
      @GwtIncompatible // Shorts.toByteArray
      public void testToByteArray() {
        assertThat(Shorts.toByteArray((short) 0x2345)).isEqualTo(new byte[] {0x23, 0x45});
        assertThat(Shorts.toByteArray((short) 0xFEDC)).isEqualTo(new byte[] {(byte) 0xFE, (byte) 0xDC});
      }
    
      @GwtIncompatible // Shorts.fromByteArray
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Thu Feb 29 15:43:06 GMT 2024
    - 26.6K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/internal/http2/MockHttp2Peer.kt

          length: Int,
        ) {
          check(type == -1)
          this.type = Http2.TYPE_DATA
          this.inFinished = inFinished
          this.streamId = streamId
          this.data = source.readByteString(length.toLong()).toByteArray()
        }
    
        override fun rstStream(
          streamId: Int,
          errorCode: ErrorCode,
        ) {
          check(type == -1)
          this.type = Http2.TYPE_RST_STREAM
          this.streamId = streamId
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 8.7K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/base/Utf8Test.java

        return new String(chars);
      }
    
      private static byte[] toByteArray(int... bytes) {
        byte[] realBytes = new byte[bytes.length];
        for (int i = 0; i < bytes.length; i++) {
          realBytes[i] = (byte) bytes[i];
        }
        return realBytes;
      }
    
      private static void assertWellFormed(int... bytes) {
        assertTrue(Utf8.isWellFormed(toByteArray(bytes)));
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Fri Feb 09 15:49:48 GMT 2024
    - 12.7K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/base/Utf8Test.java

        return new String(chars);
      }
    
      private static byte[] toByteArray(int... bytes) {
        byte[] realBytes = new byte[bytes.length];
        for (int i = 0; i < bytes.length; i++) {
          realBytes[i] = (byte) bytes[i];
        }
        return realBytes;
      }
    
      private static void assertWellFormed(int... bytes) {
        assertTrue(Utf8.isWellFormed(toByteArray(bytes)));
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Fri Feb 09 15:49:48 GMT 2024
    - 12.7K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/internal/http2/Http2ConnectionTest.kt

        assertThat(data1.type).isEqualTo(Http2.TYPE_DATA)
        assertThat(data1.streamId).isEqualTo(3)
        assertArrayEquals("abcde".toByteArray(), data1.data)
        val data2 = peer.takeFrame()
        assertThat(data2.type).isEqualTo(Http2.TYPE_DATA)
        assertThat(data2.streamId).isEqualTo(3)
        assertArrayEquals("fghi".toByteArray(), data2.data)
      }
    
      /**
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 75.4K bytes
    - Viewed (0)
  8. src/main/java/org/codelibs/fess/timer/MonitorTarget.java

                exception.printStackTrace(writer);
                writer.flush();
                append(buf, "exception", () -> StringEscapeUtils.escapeJson(new String(baos.toByteArray(), Constants.CHARSET_UTF_8)));
            } catch (final IOException e) {
                append(buf, "exception", () -> StringEscapeUtils.escapeJson(e.getMessage()));
            }
            return buf;
        }
    Java
    - Registered: Mon May 06 08:04:11 GMT 2024
    - Last Modified: Thu Feb 22 01:37:57 GMT 2024
    - 3K bytes
    - Viewed (0)
  9. src/main/java/org/codelibs/core/io/SerializeUtil.java

                final ObjectOutputStream oos = new ObjectOutputStream(baos);
                try {
                    oos.writeObject(obj);
                } finally {
                    oos.close();
                }
                return baos.toByteArray();
            } catch (final IOException ex) {
                throw new IORuntimeException(ex);
            }
        }
    
        /**
         * {@literal byte}の配列をオブジェクトに変換します。
         *
         * @param bytes
    Java
    - Registered: Fri May 03 20:58:11 GMT 2024
    - Last Modified: Thu Mar 07 01:59:08 GMT 2024
    - 3.5K bytes
    - Viewed (0)
  10. src/main/java/org/codelibs/core/io/InputStreamUtil.java

            assertArgumentNotNull("is", is);
    
            final ByteArrayOutputStream os = new ByteArrayOutputStream(BUF_SIZE);
            CopyUtil.copy(is, os);
            return os.toByteArray();
        }
    
        /**
         * {@link InputStream#available()}の例外処理をラップしたメソッドです。
         *
         * @param is
         *            入力ストリーム。{@literal null}であってはいけません
         * @return 可能なサイズ
         */
    Java
    - Registered: Fri May 03 20:58:11 GMT 2024
    - Last Modified: Thu Mar 07 01:59:08 GMT 2024
    - 3.2K bytes
    - Viewed (0)
Back to top