Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for toByteArray (0.1 sec)

  1. compat/maven-model/src/test/java/org/apache/maven/model/SerializationTest.java

            try (ObjectOutputStream oos = new ObjectOutputStream(baos)) {
                oos.writeObject(build);
            }
    
            Build build2;
            ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
            try (ObjectInputStream ois = new ObjectInputStream(bais)) {
                build2 = (Build) ois.readObject();
            }
    
            assertNotNull(build2);
        }
    
        @Test
    Registered: Sun Nov 03 03:35:11 UTC 2024
    - Last Modified: Fri Oct 25 12:31:46 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/math/StatsTest.java

            .of(LONG_MANY_VALUES_MEAN);
      }
    
      public void testToByteArrayAndFromByteArrayRoundTrip() {
        for (Stats stats : ALL_STATS) {
          byte[] statsByteArray = stats.toByteArray();
    
          // Round trip to byte array and back
          assertThat(Stats.fromByteArray(statsByteArray)).isEqualTo(stats);
        }
      }
    
      public void testFromByteArray_withNullInputThrowsNullPointerException() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 23 16:45:30 UTC 2024
    - 33.3K bytes
    - Viewed (0)
  3. build-logic-commons/basics/src/main/kotlin/gradlebuild/basics/classanalysis/AnalyzeAndShade.kt

                            )
    
                            classesDir.resolve(details.outputClassFilename).apply {
                                parentFile.mkdirs()
                                writeBytes(classWriter.toByteArray())
                            }
                        } catch (exception: Exception) {
                            throw ClassAnalysisException("Could not transform class from ${file.toFile()}", exception)
                        }
    Registered: Wed Nov 06 11:36:14 UTC 2024
    - Last Modified: Mon Oct 28 12:55:30 UTC 2024
    - 6.8K bytes
    - Viewed (0)
  4. compat/maven-embedder/src/test/java/org/apache/maven/cli/props/MavenPropertiesTest.java

            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            properties.save(baos);
    
            properties = new MavenProperties();
            properties.load(new ByteArrayInputStream(baos.toByteArray()));
            Object o22 = properties.get(KEY1);
            assertEquals(VALUE1, o22);
            for (Map.Entry<String, String> entry : properties.entrySet()) {
                entry.setValue(entry.getValue() + "x");
            }
    Registered: Sun Nov 03 03:35:11 UTC 2024
    - Last Modified: Fri Oct 25 12:31:46 UTC 2024
    - 16.4K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/collect/SetsTest.java

        ObjectOutputStream out = new ObjectOutputStream(bos);
    
        out.writeObject(original);
    
        byte[] handle = toByteArray(baseWireHandle + handleOffset);
        byte[] ref = prepended(TC_REFERENCE, handle);
        bos.write(ref);
    
        return bos.toByteArray();
      }
    
      private static byte[] prepended(byte b, byte[] array) {
        byte[] out = new byte[array.length + 1];
        out[0] = b;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 48.6K bytes
    - Viewed (0)
  6. compat/maven-repository-metadata/src/test/java/org/apache/maven/artifact/repository/metadata/MetadataTest.java

            new MetadataStaxWriter().write(baos, source.getDelegate());
            Metadata source2 =
                    new Metadata(new MetadataStaxReader().read(new ByteArrayInputStream(baos.toByteArray()), true));
            assertNotNull(source2);
        }
    
        /*-- START helper methods to populate metadata objects ---*/
        private static final String SNAPSHOT = "SNAPSHOT";
    
    Registered: Sun Nov 03 03:35:11 UTC 2024
    - Last Modified: Fri Oct 25 12:31:46 UTC 2024
    - 13.7K bytes
    - Viewed (0)
  7. guava/src/com/google/common/math/Stats.java

      /**
       * Gets a byte array representation of this instance.
       *
       * <p><b>Note:</b> No guarantees are made regarding stability of the representation between
       * versions.
       */
      public byte[] toByteArray() {
        ByteBuffer buff = ByteBuffer.allocate(BYTES).order(ByteOrder.LITTLE_ENDIAN);
        writeTo(buff);
        return buff.array();
      }
    
      /**
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 23 16:45:30 UTC 2024
    - 24.9K bytes
    - Viewed (0)
  8. compat/maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java

                // expected
            } finally {
                // restore sysout
                System.setOut(oldOut);
            }
            String versionOut = new String(systemOut.toByteArray(), StandardCharsets.UTF_8);
    
            // then
            assertEquals(stripAnsiCodes(versionOut), versionOut);
        }
    
        @Test
        void populatePropertiesCanContainEqualsSign() throws Exception {
    Registered: Sun Nov 03 03:35:11 UTC 2024
    - Last Modified: Fri Oct 25 12:31:46 UTC 2024
    - 30.3K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/primitives/Ints.java

       * use a shared {@link java.nio.ByteBuffer} instance, or use {@link
       * com.google.common.io.ByteStreams#newDataOutput()} to get a growable buffer.
       */
      public static byte[] toByteArray(int value) {
        return new byte[] {
          (byte) (value >> 24), (byte) (value >> 16), (byte) (value >> 8), (byte) value
        };
      }
    
      /**
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 25 18:05:56 UTC 2024
    - 31K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/primitives/Longs.java

       * use a shared {@link java.nio.ByteBuffer} instance, or use {@link
       * com.google.common.io.ByteStreams#newDataOutput()} to get a growable buffer.
       */
      public static byte[] toByteArray(long value) {
        // Note that this code needs to stay compatible with GWT, which has known
        // bugs when narrowing byte casts of long values occur.
        byte[] result = new byte[8];
        for (int i = 7; i >= 0; i--) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 25 18:05:56 UTC 2024
    - 29.3K bytes
    - Viewed (0)
Back to top