Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for asOutputStream (0.21 sec)

  1. android/guava/src/com/google/common/hash/Funnels.java

       *
       * <p>The {@code close} and {@code flush} methods of the returned {@code OutputStream} do nothing,
       * and no method throws {@code IOException}.
       *
       * @since 13.0
       */
      public static OutputStream asOutputStream(PrimitiveSink sink) {
        return new SinkAsStream(sink);
      }
    
      private static class SinkAsStream extends OutputStream {
        final PrimitiveSink sink;
    
        SinkAsStream(PrimitiveSink sink) {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed May 25 20:32:46 GMT 2022
    - 7.3K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/hash/FunnelsTest.java

          fail();
        } catch (NullPointerException ok) {
        }
      }
    
      public void testAsOutputStream() throws Exception {
        PrimitiveSink sink = mock(PrimitiveSink.class);
        OutputStream out = Funnels.asOutputStream(sink);
        byte[] bytes = {1, 2, 3, 4};
        out.write(255);
        out.write(bytes);
        out.write(bytes, 1, 2);
        verify(sink).putByte((byte) 255);
        verify(sink).putBytes(bytes);
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Fri Oct 02 16:24:50 GMT 2020
    - 5.9K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/hash/FunnelsTest.java

          fail();
        } catch (NullPointerException ok) {
        }
      }
    
      public void testAsOutputStream() throws Exception {
        PrimitiveSink sink = mock(PrimitiveSink.class);
        OutputStream out = Funnels.asOutputStream(sink);
        byte[] bytes = {1, 2, 3, 4};
        out.write(255);
        out.write(bytes);
        out.write(bytes, 1, 2);
        verify(sink).putByte((byte) 255);
        verify(sink).putBytes(bytes);
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Fri Oct 02 16:24:50 GMT 2020
    - 5.9K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/io/ByteSource.java

       * @throws IOException if an I/O error occurs while reading from this source
       */
      public HashCode hash(HashFunction hashFunction) throws IOException {
        Hasher hasher = hashFunction.newHasher();
        copyTo(Funnels.asOutputStream(hasher));
        return hasher.hash();
      }
    
      /**
       * Checks that the contents of this byte source are equal to the contents of the given byte
       * source.
       *
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed May 17 14:35:11 GMT 2023
    - 26.2K bytes
    - Viewed (0)
Back to top