Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for writeWireFormat (0.32 sec)

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

            packet.questionClass = NameServicePacket.IN;
    
            when(mockQuestionName.writeWireFormat(any(byte[].class), anyInt())).thenReturn(10); // Mock name length
    
            int written = packet.writeQuestionSectionWireFormat(dst, 0);
            assertEquals(14, written); // 10 (name) + 2 (type) + 2 (class)
            verify(mockQuestionName).writeWireFormat(dst, 0);
            assertEquals((byte) 0x00, dst[10]); // questionType high byte
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 17.9K bytes
    - Viewed (0)
  2. src/main/java/jcifs/netbios/NameServicePacket.java

            this.config = config;
            this.isRecurDesired = true;
            this.isBroadcast = true;
            this.questionCount = 1;
            this.questionClass = IN;
        }
    
        int writeWireFormat(final byte[] dst, int dstIndex) {
            final int start = dstIndex;
            dstIndex += writeHeaderWireFormat(dst, dstIndex);
            dstIndex += writeBodyWireFormat(dst, dstIndex);
            return dstIndex - start;
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 11.1K bytes
    - Viewed (0)
  3. src/main/java/jcifs/smb1/netbios/NameServicePacket.java

        InetAddress addr;
    
        NameServicePacket() {
            isRecurDesired = true;
            isBroadcast = true;
            questionCount = 1;
            questionClass = IN;
        }
    
        int writeWireFormat(final byte[] dst, int dstIndex) {
            final int start = dstIndex;
            dstIndex += writeHeaderWireFormat(dst, dstIndex);
            dstIndex += writeBodyWireFormat(dst, dstIndex);
            return dstIndex - start;
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 10.6K bytes
    - Viewed (0)
  4. src/test/java/jcifs/netbios/SessionServicePacketTest.java

        // Tests for instance methods
    
        @Test
        @DisplayName("writeWireFormat should write header and trailer")
        void testWriteWireFormat() {
            packet.type = SessionServicePacket.SESSION_MESSAGE;
            packet.trailerLength = 10; // Mock trailer will write 10 bytes
    
            byte[] dst = new byte[50];
            int totalWritten = packet.writeWireFormat(dst, 0);
    
            assertEquals(14, totalWritten); // 4 header + 10 trailer
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 15.5K bytes
    - Viewed (0)
  5. src/test/java/jcifs/netbios/NodeStatusRequestTest.java

            lenient().when(mockConfig.getNetbiosScope()).thenReturn("DEFAULT.SCOPE");
            lenient().when(mockConfig.getOemEncoding()).thenReturn("UTF-8");
    
            // Setup mock name
            lenient().when(mockName.writeWireFormat(any(byte[].class), anyInt())).thenReturn(34);
            mockName.hexCode = 0x20;
            mockName.name = "TEST";
            mockName.scope = "test.scope";
        }
    
        @Test
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 13.9K bytes
    - Viewed (0)
  6. src/test/java/jcifs/netbios/NameTest.java

        }
    
        @Test
        void writeWireFormat_shouldEncodeNameCorrectly() {
            Name name = new Name(mockConfig, "TEST", 0x20, null);
            byte[] dst = new byte[100];
    
            int length = name.writeWireFormat(dst, 0);
    
            // Check first byte is 0x20
            assertEquals(0x20, dst[0]);
    
            // Check encoded name (TEST -> encoded as pairs)
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 19.4K bytes
    - Viewed (0)
  7. src/test/java/jcifs/netbios/SessionRequestPacketTest.java

                    new TestNetbiosName("WORKSTATION1", 0x00, "CORP.LOCAL"));
    
            // Write to buffer
            byte[] buffer = new byte[512];
            int written = originalPacket.writeWireFormat(buffer, 0);
    
            // Read from buffer
            ByteArrayInputStream bais = new ByteArrayInputStream(buffer);
            SessionRequestPacket readPacket = new SessionRequestPacket(mockConfig);
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 11.5K bytes
    - Viewed (0)
  8. src/main/java/jcifs/netbios/NameServiceClientImpl.java

                            nid = request.nameTrnId;
    
                            this.out.setAddress(request.addr);
                            this.out.setLength(request.writeWireFormat(this.snd_buf, 0));
                            response.received = false;
    
                            this.responseTable.put(nid, response);
                            ensureOpen(timeout + 1000);
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 38.5K bytes
    - Viewed (0)
  9. src/main/java/jcifs/smb1/netbios/NameServiceClient.java

                            request.nameTrnId = getNextNameTrnId();
                            nid = request.nameTrnId;
    
                            out.setAddress(request.addr);
                            out.setLength(request.writeWireFormat(snd_buf, 0));
                            response.received = false;
    
                            responseTable.put(nid, response);
                            ensureOpen(timeout + 1000);
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 17.6K bytes
    - Viewed (0)
  10. src/main/java/jcifs/smb1/smb1/SmbTransport.java

                in = socket.getInputStream();
    
                final SessionServicePacket ssp = new SessionRequestPacket(calledName, NbtAddress.getLocalName());
                out.write(sbuf, 0, ssp.writeWireFormat(sbuf, 0));
                if (readn(in, sbuf, 0, 4) < 4) {
                    try {
                        socket.close();
                    } catch (final IOException ioe) {}
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 31.8K bytes
    - Viewed (0)
Back to top