Java 类com.google.common.hash.AbstractStreamingHashFunction.AbstractStreamingHasher 实例源码

项目:guava-mock    文件:FunnelsTest.java   
private static void assertNullsThrowException(Funnel<?> funnel) {
  PrimitiveSink primitiveSink = new AbstractStreamingHasher(4, 4) {
    @Override HashCode makeHash() { throw new UnsupportedOperationException(); }

    @Override protected void process(ByteBuffer bb) {
      while (bb.hasRemaining()) {
        bb.get();
      }
    }
  };
  try {
    funnel.funnel(null, primitiveSink);
    fail();
  } catch (NullPointerException ok) {}
}
项目:googles-monorepo-demo    文件:FunnelsTest.java   
private static void assertNullsThrowException(Funnel<?> funnel) {
  PrimitiveSink primitiveSink = new AbstractStreamingHasher(4, 4) {
    @Override HashCode makeHash() { throw new UnsupportedOperationException(); }

    @Override protected void process(ByteBuffer bb) {
      while (bb.hasRemaining()) {
        bb.get();
      }
    }
  };
  try {
    funnel.funnel(null, primitiveSink);
    fail();
  } catch (NullPointerException ok) {}
}
项目:guava-libraries    文件:FunnelsTest.java   
private static void assertNullsThrowException(Funnel<?> funnel) {
  PrimitiveSink primitiveSink = new AbstractStreamingHasher(4, 4) {
    @Override HashCode makeHash() { throw new UnsupportedOperationException(); }

    @Override protected void process(ByteBuffer bb) {
      while (bb.hasRemaining()) {
        bb.get();
      }
    }
  };
  try {
    funnel.funnel(null, primitiveSink);
    fail();
  } catch (NullPointerException ok) {}
}