Examples of SmbRandomAccessFile


Examples of jcifs.smb.SmbRandomAccessFile

            modes.append('w');
        }

        try
        {
            raf = new SmbRandomAccessFile(smbFile, modes.toString());
            rafis = new InputStream()
            {
                public int read() throws IOException
                {
                    return raf.readByte();
View Full Code Here

Examples of jcifs.smb.SmbRandomAccessFile

        if (fileOffset > smbFile.length())
            return;

        byte[] buf = new byte[BUFFER_SIZE];

        SmbRandomAccessFile raf = new SmbRandomAccessFile(smbFile, "r");

        raf.seek(fileOffset);

        int bc;
        int rem = dest.remaining();
        while ((bc = raf.read(buf)) > 0 && rem > 0) {
            dest.put(buf, 0, Math.min(bc, dest.remaining()));
            rem = dest.remaining();
        }
        raf.close();
    }
View Full Code Here

Examples of jcifs.smb.SmbRandomAccessFile

    /**
     * @see org.jnode.fs.FSFile#setLength(long)
     */
    public void setLength(long length) throws IOException {
        SmbRandomAccessFile raf = new SmbRandomAccessFile(smbFile, "rw");
        raf.setLength(length);
        raf.close();
    }
View Full Code Here

Examples of jcifs.smb.SmbRandomAccessFile

    /**
     * @see org.jnode.fs.FSFile#write(long, java.nio.ByteBuffer)
     */
    public void write(long fileOffset, ByteBuffer src) throws IOException {
        SmbRandomAccessFile raf = new SmbRandomAccessFile(smbFile, "rw");

        if (fileOffset > raf.length())
            raf.setLength(fileOffset);

        raf.seek(fileOffset);

        byte[] buf = new byte[BUFFER_SIZE];

        while (src.remaining() > 0) {
            int bc = Math.min(BUFFER_SIZE, src.remaining());
            src.get(buf, 0, bc);
            raf.write(buf, 0, bc);
        }

        raf.close();
    }
View Full Code Here

Examples of jcifs.smb.SmbRandomAccessFile

    {
        super(mode);

        try
        {
            raf = new SmbRandomAccessFile(smbFile, mode.getModeString());
            rafis = new InputStream()
            {
                @Override
                public int read() throws IOException
                {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.