Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 300 for out (0.43 sec)

  1. android/guava-tests/test/com/google/common/io/FileBackedOutputStreamTest.java

        FileBackedOutputStream out = new FileBackedOutputStream(50);
        ByteSource source = out.asByteSource();
    
        if (JAVA_IO_TMPDIR.value().equals("/sdcard")) {
          assertThrows(IOException.class, () -> out.write(data));
          return;
        }
        out.write(data);
        assertTrue(Arrays.equals(data, source.read()));
    
        out.close();
        assertThrows(IOException.class, () -> out.write(42));
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 5.5K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/io/LittleEndianDataOutputStreamTest.java

      private LittleEndianDataOutputStream out = new LittleEndianDataOutputStream(baos);
    
      public void testWriteLittleEndian() throws IOException {
    
        /* Write out various test values in LITTLE ENDIAN FORMAT */
        out.write(new byte[] {-100, 100});
        out.writeBoolean(true);
        out.writeBoolean(false);
        out.writeByte(100);
        out.writeByte(-100);
        out.writeByte((byte) 200);
        out.writeChar('a');
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4.7K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/io/CountingOutputStreamTest.java

      public void testCount() throws Exception {
        int written = 0;
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        CountingOutputStream counter = new CountingOutputStream(out);
        assertEquals(written, out.size());
        assertEquals(written, counter.getCount());
    
        counter.write(0);
        written += 1;
        assertEquals(written, out.size());
        assertEquals(written, counter.getCount());
    
        byte[] data = new byte[10];
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 1.9K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/io/CountingOutputStreamTest.java

      public void testCount() throws Exception {
        int written = 0;
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        CountingOutputStream counter = new CountingOutputStream(out);
        assertEquals(written, out.size());
        assertEquals(written, counter.getCount());
    
        counter.write(0);
        written += 1;
        assertEquals(written, out.size());
        assertEquals(written, counter.getCount());
    
        byte[] data = new byte[10];
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 1.9K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/io/CharSourceTest.java

            }
    
            for (CharSink out : BROKEN_SINKS) {
              runFailureTest(newNormalCharSource(), out);
              assertTrue(logHandler.getStoredLogRecords().isEmpty());
    
              runFailureTest(BROKEN_CLOSE_SOURCE, out);
              assertEquals(1, getAndResetRecords(logHandler));
            }
    
            for (CharSource in : BROKEN_SOURCES) {
              for (CharSink out : BROKEN_SINKS) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 12K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/io/CountingOutputStream.java

       *
       * @param out the output stream to be wrapped
       */
      public CountingOutputStream(OutputStream out) {
        super(checkNotNull(out));
      }
    
      /** Returns the number of bytes written. */
      public long getCount() {
        return count;
      }
    
      @Override
      public void write(byte[] b, int off, int len) throws IOException {
        out.write(b, off, len);
        count += len;
      }
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Feb 28 20:13:02 GMT 2023
    - 2K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/io/CharSink.java

       */
      public void write(CharSequence charSequence) throws IOException {
        checkNotNull(charSequence);
    
        Closer closer = Closer.create();
        try {
          Writer out = closer.register(openStream());
          out.append(charSequence);
          out.flush(); // https://code.google.com/p/guava-libraries/issues/detail?id=1330
        } catch (Throwable e) {
          throw closer.rethrow(e);
        } finally {
          closer.close();
        }
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Feb 28 20:13:02 GMT 2023
    - 6.1K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/io/SourceSinkFactories.java

        @Override
        public ByteSource createSource(byte[] bytes) throws IOException {
          checkNotNull(bytes);
          File file = createFile();
          OutputStream out = new FileOutputStream(file);
          try {
            out.write(bytes);
          } finally {
            out.close();
          }
          return Files.asByteSource(file);
        }
    
        @Override
        public byte[] getExpected(byte[] bytes) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Apr 06 12:56:11 GMT 2023
    - 12.7K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/io/TestOutputStream.java

      private final ImmutableSet<TestOption> options;
      private boolean closed;
    
      public TestOutputStream(OutputStream out, TestOption... options) throws IOException {
        this(out, Arrays.asList(options));
      }
    
      public TestOutputStream(OutputStream out, Iterable<TestOption> options) throws IOException {
        super(checkNotNull(out));
        this.options = ImmutableSet.copyOf(options);
        throwIf(OPEN_THROWS);
      }
    
      public boolean closed() {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 2.2K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/hash/AbstractNonStreamingHashFunctionTest.java

            final ByteArrayOutputStream out = new ByteArrayOutputStream();
    
            @Override
            protected HashCode makeHash() {
              return HashCode.fromBytes(out.toByteArray());
            }
    
            @Override
            protected void process(ByteBuffer bb) {
              while (bb.hasRemaining()) {
                out.write(bb.get());
              }
            }
    
            @Override
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4.4K bytes
    - Viewed (0)
Back to top