int readWireFormat( InputStream in, byte[] buffer, int bufferIndex ) throws IOException { readHeaderWireFormat( in, buffer, bufferIndex ); return HEADER_LENGTH + readTrailerWireFormat( in, buffer, bufferIndex ); } int writeHeaderWireFormat( byte[] dst, int dstIndex ) {
int readHeaderWireFormat( InputStream in, byte[] buffer, int bufferIndex ) throws IOException { type = buffer[bufferIndex++] & 0xFF; length = (( buffer[bufferIndex] & 0x01 ) << 16 ) + readInt2( buffer, bufferIndex + 1 ); return HEADER_LENGTH; }
static int readPacketType ( InputStream in, byte[] buffer, int bufferIndex ) throws IOException { int n; if ( ( n = readn(in, buffer, bufferIndex, HEADER_LENGTH) ) != HEADER_LENGTH ) { if ( n == -1 ) { return -1; } throw new IOException("unexpected EOF reading netbios session header"); } int t = buffer[ bufferIndex ] & 0xFF; return t; }
public int writeWireFormat( byte[] dst, int dstIndex ) { length = writeTrailerWireFormat( dst, dstIndex + HEADER_LENGTH ); writeHeaderWireFormat( dst, dstIndex ); return HEADER_LENGTH + length; } int readWireFormat( InputStream in, byte[] buffer, int bufferIndex ) throws IOException {
out.write( buffer, 0, ssp0.writeWireFormat( buffer, 0 )); type = ssp0.readPacketType( in, buffer, 0 ); } catch( IOException ioe ) { close();
int writeHeaderWireFormat( byte[] dst, int dstIndex ) { dst[dstIndex++] = (byte)type; if( length > 0x0000FFFF ) { dst[dstIndex] = (byte)0x01; } dstIndex++; writeInt2( length, dst, dstIndex ); return HEADER_LENGTH; } int readHeaderWireFormat( InputStream in,
out.write( sbuf, 0, ssp.writeWireFormat( sbuf, 0 )); if (readn( in, sbuf, 0, 4 ) < 4) { try {
switch( SessionServicePacket.readPacketType( in, header, 0 )) { case SessionServicePacket.SESSION_KEEP_ALIVE: break; case SessionServicePacket.SESSION_MESSAGE: bip = SessionServicePacket.readLength( header, 0 ); break; case -1:
int readTrailerWireFormat( InputStream in, byte[] buffer, int bufferIndex ) throws IOException { if( in.read( buffer, bufferIndex, length ) != length ) { throw new IOException( "unexpected EOF reading netbios retarget session response" ); } int addr = readInt4( buffer, bufferIndex ); bufferIndex += 4; retargetAddress = new NbtAddress( null, addr, false, NbtAddress.B_NODE ); retargetPort = readInt2( buffer, bufferIndex ); return length; } }
/** * @param dst * @param dstIndex * @return written bytes */ public int writeWireFormat ( byte[] dst, int dstIndex ) { this.length = writeTrailerWireFormat(dst, dstIndex + HEADER_LENGTH); writeHeaderWireFormat(dst, dstIndex); return HEADER_LENGTH + this.length; }
out.write( buffer, 0, ssp0.writeWireFormat( buffer, 0 )); type = ssp0.readPacketType( in, buffer, 0 ); } catch( IOException ioe ) { close();
int writeHeaderWireFormat( byte[] dst, int dstIndex ) { dst[dstIndex++] = (byte)type; if( length > 0x0000FFFF ) { dst[dstIndex] = (byte)0x01; } dstIndex++; writeInt2( length, dst, dstIndex ); return HEADER_LENGTH; } int readHeaderWireFormat( InputStream in,
out.write( sbuf, 0, ssp.writeWireFormat( sbuf, 0 )); if (readn( in, sbuf, 0, 4 ) < 4) { try {
switch( SessionServicePacket.readPacketType( in, header, 0 )) { case SessionServicePacket.SESSION_KEEP_ALIVE: break; case SessionServicePacket.SESSION_MESSAGE: bip = SessionServicePacket.readLength( header, 0 ); break; case -1:
public int writeWireFormat( byte[] dst, int dstIndex ) { length = writeTrailerWireFormat( dst, dstIndex + HEADER_LENGTH ); writeHeaderWireFormat( dst, dstIndex ); return HEADER_LENGTH + length; } int readWireFormat( InputStream in, byte[] buffer, int bufferIndex ) throws IOException {
int readWireFormat( InputStream in, byte[] buffer, int bufferIndex ) throws IOException { readHeaderWireFormat( in, buffer, bufferIndex ); return HEADER_LENGTH + readTrailerWireFormat( in, buffer, bufferIndex ); } int writeHeaderWireFormat( byte[] dst, int dstIndex ) {
out.write( buffer, 0, ssp0.writeWireFormat( buffer, 0 )); type = ssp0.readPacketType( in, buffer, 0 ); } catch( IOException ioe ) { close();
int writeHeaderWireFormat ( byte[] dst, int dstIndex ) { dst[ dstIndex++ ] = (byte) this.type; if ( this.length > 0x0000FFFF ) { dst[ dstIndex ] = (byte) 0x01; } dstIndex++; writeInt2(this.length, dst, dstIndex); return HEADER_LENGTH; }
int readHeaderWireFormat( InputStream in, byte[] buffer, int bufferIndex ) throws IOException { type = buffer[bufferIndex++] & 0xFF; length = (( buffer[bufferIndex] & 0x01 ) << 16 ) + readInt2( buffer, bufferIndex + 1 ); return HEADER_LENGTH; }
static int readPacketType ( InputStream in, byte[] buffer, int bufferIndex ) throws IOException { int n; if ( ( n = readn(in, buffer, bufferIndex, HEADER_LENGTH) ) != HEADER_LENGTH ) { if ( n == -1 ) { return -1; } throw new IOException("unexpected EOF reading netbios session header"); } int t = buffer[ bufferIndex ] & 0xFF; return t; }