SmbFileInputStream( SmbFile file, int openFlags ) throws SmbException, MalformedURLException, UnknownHostException { this.file = file; this.openFlags = openFlags & 0xFFFF; this.access = (openFlags >>> 16) & 0xFFFF; if (file.type != SmbFile.TYPE_NAMED_PIPE) { file.open( openFlags, access, SmbFile.ATTR_NORMAL, 0 ); this.openFlags &= ~(SmbFile.O_CREAT | SmbFile.O_TRUNC); } else { file.connect0(); } readSize = Math.min( file.tree.session.transport.rcv_buf_size - 70, file.tree.session.transport.server.maxBufferSize - 70 ); }
SmbFileInputStream( SmbFile file, int openFlags ) throws SmbException, MalformedURLException, UnknownHostException { this.file = file; this.openFlags = openFlags & 0xFFFF; this.access = (openFlags >>> 16) & 0xFFFF; if (file.type != SmbFile.TYPE_NAMED_PIPE) { file.open( openFlags, access, SmbFile.ATTR_NORMAL, 0 ); this.openFlags &= ~(SmbFile.O_CREAT | SmbFile.O_TRUNC); } else { file.connect0(); } readSize = Math.min( file.tree.session.transport.rcv_buf_size - 70, file.tree.session.transport.server.maxBufferSize - 70 ); }
SmbFileInputStream( SmbFile file, int openFlags ) throws SmbException, MalformedURLException, UnknownHostException { this.file = file; this.openFlags = openFlags & 0xFFFF; this.access = (openFlags >>> 16) & 0xFFFF; if (file.type != SmbFile.TYPE_NAMED_PIPE) { file.open( openFlags, access, SmbFile.ATTR_NORMAL, 0 ); this.openFlags &= ~(SmbFile.O_CREAT | SmbFile.O_TRUNC); } else { file.connect0(); } readSize = Math.min( file.tree.session.transport.rcv_buf_size - 70, file.tree.session.transport.server.maxBufferSize - 70 ); }
SmbFileInputStream( SmbFile file, int openFlags ) throws SmbException, MalformedURLException, UnknownHostException { this.file = file; this.openFlags = openFlags & 0xFFFF; this.access = (openFlags >>> 16) & 0xFFFF; if (file.type != SmbFile.TYPE_NAMED_PIPE) { file.open( openFlags, access, SmbFile.ATTR_NORMAL, 0 ); this.openFlags &= ~(SmbFile.O_CREAT | SmbFile.O_TRUNC); } else { file.connect0(); } readSize = Math.min( file.tree.session.transport.rcv_buf_size - 70, file.tree.session.transport.server.maxBufferSize - 70 ); }
public SmbRandomAccessFile( SmbFile file, String mode ) throws SmbException, MalformedURLException, UnknownHostException { this.file = file; if( mode.equals( "r" )) { this.openFlags = SmbFile.O_CREAT | SmbFile.O_RDONLY; } else if( mode.equals( "rw" )) { this.openFlags = SmbFile.O_CREAT | SmbFile.O_RDWR | SmbFile.O_APPEND; write_andx_resp = new SmbComWriteAndXResponse(); options = WRITE_OPTIONS; access = SmbConstants.FILE_READ_DATA | SmbConstants.FILE_WRITE_DATA; } else { throw new IllegalArgumentException( "Invalid mode" ); } file.open( openFlags, access, SmbFile.ATTR_NORMAL, options ); readSize = file.tree.session.transport.rcv_buf_size - 70; writeSize = file.tree.session.transport.snd_buf_size - 70; fp = 0L; }
public SmbRandomAccessFile( SmbFile file, String mode ) throws SmbException, MalformedURLException, UnknownHostException { this.file = file; if( mode.equals( "r" )) { this.openFlags = SmbFile.O_CREAT | SmbFile.O_RDONLY; } else if( mode.equals( "rw" )) { this.openFlags = SmbFile.O_CREAT | SmbFile.O_RDWR | SmbFile.O_APPEND; write_andx_resp = new SmbComWriteAndXResponse(); options = WRITE_OPTIONS; access = SmbConstants.FILE_READ_DATA | SmbConstants.FILE_WRITE_DATA; } else { throw new IllegalArgumentException( "Invalid mode" ); } file.open( openFlags, access, SmbFile.ATTR_NORMAL, options ); readSize = file.tree.session.transport.rcv_buf_size - 70; writeSize = file.tree.session.transport.snd_buf_size - 70; fp = 0L; }
public SmbRandomAccessFile( SmbFile file, String mode ) throws SmbException, MalformedURLException, UnknownHostException { this.file = file; if( mode.equals( "r" )) { this.openFlags = SmbFile.O_CREAT | SmbFile.O_RDONLY; } else if( mode.equals( "rw" )) { this.openFlags = SmbFile.O_CREAT | SmbFile.O_RDWR | SmbFile.O_APPEND; write_andx_resp = new SmbComWriteAndXResponse(); options = WRITE_OPTIONS; access = SmbConstants.FILE_READ_DATA | SmbConstants.FILE_WRITE_DATA; } else { throw new IllegalArgumentException( "Invalid mode" ); } file.open( openFlags, access, SmbFile.ATTR_NORMAL, options ); readSize = file.tree.session.transport.rcv_buf_size - 70; writeSize = file.tree.session.transport.snd_buf_size - 70; fp = 0L; }
public SmbRandomAccessFile( SmbFile file, String mode ) throws SmbException, MalformedURLException, UnknownHostException { this.file = file; if( mode.equals( "r" )) { this.openFlags = SmbFile.O_CREAT | SmbFile.O_RDONLY; } else if( mode.equals( "rw" )) { this.openFlags = SmbFile.O_CREAT | SmbFile.O_RDWR | SmbFile.O_APPEND; write_andx_resp = new SmbComWriteAndXResponse(); options = WRITE_OPTIONS; access = SmbConstants.FILE_READ_DATA | SmbConstants.FILE_WRITE_DATA; } else { throw new IllegalArgumentException( "Invalid mode" ); } file.open( openFlags, access, SmbFile.ATTR_NORMAL, options ); readSize = file.tree.session.transport.rcv_buf_size - 70; writeSize = file.tree.session.transport.snd_buf_size - 70; fp = 0L; }
void ensureOpen() throws IOException { // ensure file is open if( file.isOpen() == false ) { file.open( openFlags, access | SmbConstants.FILE_WRITE_DATA, SmbFile.ATTR_NORMAL, 0 ); if( append ) { fp = file.length(); } } } /**
void ensureOpen() throws IOException { // ensure file is open if( file.isOpen() == false ) { file.open( openFlags, access | SmbConstants.FILE_WRITE_DATA, SmbFile.ATTR_NORMAL, 0 ); if( append ) { fp = file.length(); } } } /**
void ensureOpen() throws IOException { // ensure file is open if( file.isOpen() == false ) { file.open( openFlags, access | SmbConstants.FILE_WRITE_DATA, SmbFile.ATTR_NORMAL, 0 ); if( append ) { fp = file.length(); } } } /**
void ensureOpen() throws IOException { // ensure file is open if( file.isOpen() == false ) { file.open( openFlags, access | SmbConstants.FILE_WRITE_DATA, SmbFile.ATTR_NORMAL, 0 ); if( append ) { fp = file.length(); } } } /**
public void write( byte b[], int off, int len ) throws SmbException { if( len <= 0 ) { return; } // ensure file is open if( file.isOpen() == false ) { file.open( openFlags, 0, SmbFile.ATTR_NORMAL, options ); } int w; do { w = len > writeSize ? writeSize : len; file.send( new SmbComWriteAndX( file.fid, fp, len - w, b, off, w, null ), write_andx_resp ); fp += write_andx_resp.count; len -= write_andx_resp.count; off += write_andx_resp.count; } while( len > 0 ); } public long getFilePointer() throws SmbException {
public void write( byte b[], int off, int len ) throws SmbException { if( len <= 0 ) { return; } // ensure file is open if( file.isOpen() == false ) { file.open( openFlags, 0, SmbFile.ATTR_NORMAL, options ); } int w; do { w = len > writeSize ? writeSize : len; file.send( new SmbComWriteAndX( file.fid, fp, len - w, b, off, w, null ), write_andx_resp ); fp += write_andx_resp.count; len -= write_andx_resp.count; off += write_andx_resp.count; } while( len > 0 ); } public long getFilePointer() throws SmbException {
public void write( byte b[], int off, int len ) throws SmbException { if( len <= 0 ) { return; } // ensure file is open if( file.isOpen() == false ) { file.open( openFlags, 0, SmbFile.ATTR_NORMAL, options ); } int w; do { w = len > writeSize ? writeSize : len; file.send( new SmbComWriteAndX( file.fid, fp, len - w, b, off, w, null ), write_andx_resp ); fp += write_andx_resp.count; len -= write_andx_resp.count; off += write_andx_resp.count; } while( len > 0 ); } public long getFilePointer() throws SmbException {
public void write( byte b[], int off, int len ) throws SmbException { if( len <= 0 ) { return; } // ensure file is open if( file.isOpen() == false ) { file.open( openFlags, 0, SmbFile.ATTR_NORMAL, options ); } int w; do { w = len > writeSize ? writeSize : len; file.send( new SmbComWriteAndX( file.fid, fp, len - w, b, off, w, null ), write_andx_resp ); fp += write_andx_resp.count; len -= write_andx_resp.count; off += write_andx_resp.count; } while( len > 0 ); } public long getFilePointer() throws SmbException {
public void setLength( long newLength ) throws SmbException { // ensure file is open if( file.isOpen() == false ) { file.open( openFlags, 0, SmbFile.ATTR_NORMAL, options ); } SmbComWriteResponse rsp = new SmbComWriteResponse(); file.send( new SmbComWrite( file.fid, (int)(newLength & 0xFFFFFFFFL), 0, tmp, 0, 0 ), rsp ); } public void close() throws SmbException {
public void setLength( long newLength ) throws SmbException { // ensure file is open if( file.isOpen() == false ) { file.open( openFlags, 0, SmbFile.ATTR_NORMAL, options ); } SmbComWriteResponse rsp = new SmbComWriteResponse(); file.send( new SmbComWrite( file.fid, (int)(newLength & 0xFFFFFFFFL), 0, tmp, 0, 0 ), rsp ); } public void close() throws SmbException {
public void setLength( long newLength ) throws SmbException { // ensure file is open if( file.isOpen() == false ) { file.open( openFlags, 0, SmbFile.ATTR_NORMAL, options ); } SmbComWriteResponse rsp = new SmbComWriteResponse(); file.send( new SmbComWrite( file.fid, (int)(newLength & 0xFFFFFFFFL), 0, tmp, 0, 0 ), rsp ); } public void close() throws SmbException {
public void setLength( long newLength ) throws SmbException { // ensure file is open if( file.isOpen() == false ) { file.open( openFlags, 0, SmbFile.ATTR_NORMAL, options ); } SmbComWriteResponse rsp = new SmbComWriteResponse(); file.send( new SmbComWrite( file.fid, (int)(newLength & 0xFFFFFFFFL), 0, tmp, 0, 0 ), rsp ); } public void close() throws SmbException {