FileDocCategorySizeDatePackage
SocketOutputStream.javaAPI DocJCIFS 1.3.17 API1732Tue Oct 18 15:26:24 BST 2011jcifs.netbios

SocketOutputStream

public class SocketOutputStream extends FilterOutputStream

Fields Summary
Constructors Summary
SocketOutputStream(OutputStream out)

        super( out );
    
Methods Summary
public synchronized voidwrite(byte[] b, int off, int len)

        if( len > 0xFFFF ) {
            throw new IOException( "write too large: " + len );
        } else if( off < 4 ) {
            throw new IOException( "NetBIOS socket output buffer requires 4 bytes available before off" );
        }

        off -= 4;

        b[off + 0] = (byte)SessionServicePacket.SESSION_MESSAGE;
        b[off + 1] = (byte)0x00; 
        b[off + 2] = (byte)(( len >> 8 ) & 0xFF ); 
        b[off + 3] = (byte)( len & 0xFF ); 

        out.write( b, off, 4 + len );