- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 713 for readn (0.02 sec)
-
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) -
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) -
src/main/java/jcifs/smb1/smb1/SmbTransport.java
Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Sat Aug 16 01:32:48 UTC 2025 - 31.8K bytes - Viewed (0) -
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) -
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) -
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) -
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) -
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) -
src/test/java/jcifs/internal/smb2/tree/Smb2TreeDisconnectResponseTest.java
int read3 = response.readBytesWireFormat(buffer, 0); // Then - all reads should return same result assertEquals(4, read1); assertEquals(4, read2); assertEquals(4, read3); } @Test @DisplayName("Should validate structure size before processing") void testStructureSizeValidation() { // Given various invalid structure sizes
Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 14.1K bytes - Viewed (0) -
guava/src/com/google/common/io/ByteStreams.java
byte[] buf1 = createBuffer(); byte[] buf2 = createBuffer(); while (true) { int read1 = read(in1, buf1, 0, BUFFER_SIZE); int read2 = read(in2, buf2, 0, BUFFER_SIZE); if (read1 != read2 || !arraysEqual(buf1, buf2, read1)) { return false; } else if (read1 != BUFFER_SIZE) { return true; } } }
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Thu Jul 17 15:26:41 UTC 2025 - 31.1K bytes - Viewed (0)