Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 770 for readn (0.02 sec)

  1. src/test/java/jcifs/netbios/SessionServicePacketTest.java

            when(mockInputStream.read(any(byte[].class), anyInt(), anyInt())).thenReturn(2) // First read returns 2 bytes
                    .thenReturn(2) // Second read returns 2 bytes
                    .thenReturn(1); // Third read returns 1 byte
    
            byte[] buffer = new byte[10];
            int bytesRead = SessionServicePacket.readn(mockInputStream, buffer, 0, 5);
    
            assertEquals(5, bytesRead);
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 15.5K bytes
    - Viewed (0)
  2. cmd/metacache-stream_test.go

    	}
    
    	want = want[:0]
    	entries, err = r.readN(0, false, true, false, "")
    	if err != nil {
    		t.Fatal(err, entries.len())
    	}
    	if entries.len() != len(want) {
    		t.Fatal("unexpected length:", entries.len(), "want:", len(want))
    	}
    
    	// Reload.
    	r = loadMetacacheSample(t)
    	defer r.Close()
    	entries, err = r.readN(0, false, true, false, "")
    	if err != nil {
    		t.Fatal(err, entries.len())
    	}
    Registered: Sun Sep 07 19:28:11 UTC 2025
    - Last Modified: Wed Apr 09 14:28:39 UTC 2025
    - 15K bytes
    - Viewed (0)
  3. src/main/java/jcifs/smb1/smb1/SmbTransport.java

            do {
                if ((n = readn(in, sbuf, 0, 4)) < 4) {
                    return null;
                }
            } while (sbuf[0] == (byte) 0x85); /* Dodge NetBIOS keep-alive */
            n = readn(in, sbuf, 4, 32);
            /* read smb header */
            if (n < 32) {
                return null;
            }
            if (LogStream.level >= 4) {
                log.println("New data read: " + this);
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 31.8K bytes
    - Viewed (0)
  4. src/test/java/jcifs/util/transport/TransportTest.java

                InputStream is = new ByteArrayInputStream("Hi".getBytes());
                byte[] buffer = new byte[10];
    
                Transport.readn(is, buffer, 0, 2); // Read all
                int bytesRead = Transport.readn(is, buffer, 0, 5); // Try to read more
                assertEquals(0, bytesRead);
            }
        }
    
        @Nested
        @DisplayName("Resource management tests")
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 9.5K bytes
    - Viewed (0)
  5. src/main/java/jcifs/netbios/SessionServicePacket.java

            return ((src[srcIndex++] & 0x01) << 16) + ((src[srcIndex++] & 0xFF) << 8) + (src[srcIndex++] & 0xFF);
        }
    
        static int readn(final InputStream in, final byte[] b, final int off, final int len) throws IOException {
            int i = 0, n;
    
            while (i < len) {
                n = in.read(b, off + i, len - i);
                if (n <= 0) {
                    break;
                }
                i += n;
            }
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 5.2K bytes
    - Viewed (0)
  6. src/main/java/jcifs/smb1/netbios/SessionServicePacket.java

            return ((src[srcIndex++] & 0x01) << 16) + ((src[srcIndex++] & 0xFF) << 8) + (src[srcIndex++] & 0xFF);
        }
    
        static int readn(final InputStream in, final byte[] b, final int off, final int len) throws IOException {
            int i = 0, n;
    
            while (i < len) {
                n = in.read(b, off + i, len - i);
                if (n <= 0) {
                    break;
                }
                i += n;
            }
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 5.2K bytes
    - Viewed (0)
  7. src/main/java/jcifs/smb/SmbTransportImpl.java

        }
    
        @Override
        protected Long peekKey() throws IOException {
            do {
                if (readn(this.in, this.sbuf, 0, 4) < 4) {
                    return null;
                }
            } while (this.sbuf[0] == (byte) 0x85); /* Dodge NetBIOS keep-alive */
            /* read smb header */
            if (readn(this.in, this.sbuf, 4, SmbConstants.SMB1_HEADER_LENGTH) < SmbConstants.SMB1_HEADER_LENGTH) {
                return null;
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 69.8K bytes
    - Viewed (0)
  8. cmd/metacache-stream.go

    		select {
    		case <-ctx.Done():
    			r.err = ctx.Err()
    			return ctx.Err()
    		case dst <- meta:
    		}
    	}
    }
    
    // readFn will return all remaining objects
    // and provide a callback for each entry read in order
    // as long as true is returned on the callback.
    func (r *metacacheReader) readFn(fn func(entry metaCacheEntry) bool) error {
    	r.checkInit()
    	if r.err != nil {
    		return r.err
    	}
    	if r.current.name != "" {
    Registered: Sun Sep 07 19:28:11 UTC 2025
    - Last Modified: Wed May 07 15:37:12 UTC 2025
    - 19.5K bytes
    - Viewed (0)
  9. src/main/java/jcifs/smb1/util/transport/Transport.java

        static LogStream log = LogStream.getInstance();
    
        /**
         * Reads exactly len bytes from the input stream into the buffer.
         *
         * @param in the input stream to read from
         * @param b the buffer to read into
         * @param off the offset in the buffer to start writing
         * @param len the number of bytes to read
         * @return the number of bytes actually read
         * @throws IOException if an I/O error occurs
         */
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 11.3K bytes
    - Viewed (0)
  10. src/main/java/jcifs/util/transport/Transport.java

        /**
         * Read bytes from the input stream into a buffer
         *
         * @param in the input stream to read from
         * @param b the buffer to read into
         * @param off the offset in the buffer to start writing
         * @param len the number of bytes to read
         * @return number of bytes read
         * @throws IOException if an I/O error occurs
         */
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sun Aug 31 08:00:57 UTC 2025
    - 27.8K bytes
    - Viewed (0)
Back to top