java.io

Class FileInputStream

Implemented Interfaces:
Closeable

public class FileInputStream
extends InputStream

A FileInputStream obtains input bytes from a file in a file system. What files are available depends on the host environment.

FileInputStream is meant for reading streams of raw bytes such as image data. For reading streams of characters, consider using FileReader.

Since:
JDK1.0
See Also:
File, FileDescriptor, FileOutputStream

Constructor Summary

FileInputStream(File file)
Creates a FileInputStream by opening a connection to an actual file, the file named by the File object file in the file system.
FileInputStream(FileDescriptor fdObj)
Creates a FileInputStream by using the file descriptor fdObj, which represents an existing connection to an actual file in the file system.
FileInputStream(String name)
Creates a FileInputStream by opening a connection to an actual file, the file named by the path name name in the file system.

Method Summary

int
available()
Returns the number of bytes that can be read from this file input stream without blocking.
void
close()
Closes this file input stream and releases any system resources associated with the stream.
protected void
finalize()
Ensures that the close method of this file input stream is called when there are no more references to it.
FileChannel
getChannel()
Returns the unique FileChannel object associated with this file input stream.
FileDescriptor
getFD()
Returns the FileDescriptor object that represents the connection to the actual file in the file system being used by this FileInputStream.
int
read()
Reads a byte of data from this input stream.
int
read(b[] )
Reads up to b.length bytes of data from this input stream into an array of bytes.
int
read(b[] , int off, int len)
Reads up to len bytes of data from this input stream into an array of bytes.
long
skip(long n)
Skips over and discards n bytes of data from the input stream.

Methods inherited from class java.io.InputStream

available, close, mark, markSupported, read, read, read, reset, skip

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

FileInputStream

public FileInputStream(File file)
            throws FileNotFoundException
Creates a FileInputStream by opening a connection to an actual file, the file named by the File object file in the file system. A new FileDescriptor object is created to represent this file connection.

First, if there is a security manager, its checkRead method is called with the path represented by the file argument as its argument.

If the named file does not exist, is a directory rather than a regular file, or for some other reason cannot be opened for reading then a FileNotFoundException is thrown.

Parameters:
file - the file to be opened for reading.
Throws:
FileNotFoundException - if the file does not exist, is a directory rather than a regular file, or for some other reason cannot be opened for reading.
SecurityException - if a security manager exists and its checkRead method denies read access to the file.
Usages and Demos :

View More Examples of FileInputStream(File file)
   1:         {
   2:             FileInputStream     fis  = new FileInputStream(".");
   3:             System.out.println("1 FAIL! Should throw java.io.FileNotFoundException!");
   4:         ...
   5:             File                file = new File(".");
   6:             FileInputStream     fis  = new FileInputStream(file);
   7:             System.out.println("2 FAIL! Should throw java.io.FileNotFoundException!");
   8:         ...
   9:         {
  10:             FileInputStream     fis  = new FileInputStream(file);
  11:             System.out.println("5 Success.");

View Full Code Here
   1:       StreamTokenizer st = new StreamTokenizer(new 
   2:                                FileInputStream("./stream-tokenizer.data"));
   3: 
   4:       System.out.println("No tokens read: " + st.toString());
   5:       int j = 0;

View Full Code Here
   1:                     getSlideToken("root"), module.getPath() , "link_test.sxw",
   2:                     new FileInputStream("./test/data/link/link_test.sxw"));
   3: 
   4:         ...
   5:             action = ss.getWriteFile(getSlideToken("root"));
   6:             action.setContent(new FileInputStream("./test/data/link/test.jpg"));
   7:             action.setContentLength(new File("./test/data/link/test.jpg")
   8:                     .length());
   9:             action.setContentType("image/jpeg");

View Full Code Here
   1:     private Object readHandle() throws Exception {
   2:         ObjectInputStream in = new ObjectInputStream(new FileInputStream("../temp/" + this.getClass() + ".ser"));
   3:         Object handle = in.readObject();
   4:         in.close();
   5:         return handle;

View Full Code Here
   1:     private Object readHandle() throws Exception {
   2:         ObjectInputStream in = new ObjectInputStream(new FileInputStream("../temp/" + this.getClass() + ".ser"));
   3:         Object handle = in.readObject();
   4:         in.close();
   5:         return handle;

View Full Code Here

FileInputStream

public FileInputStream(FileDescriptor fdObj)
Creates a FileInputStream by using the file descriptor fdObj, which represents an existing connection to an actual file in the file system.

If there is a security manager, its checkRead method is called with the file descriptor fdObj as its argument to see if it's ok to read the file descriptor. If read access is denied to the file descriptor a SecurityException is thrown.

If fdObj is null then a NullPointerException is thrown.

Parameters:
fdObj - the file descriptor to be opened for reading.
Throws:
SecurityException - if a security manager exists and its checkRead method denies read access to the file descriptor.
Usages and Demos :

View More Examples of FileInputStream(FileDescriptor fdObj)
   1:         {
   2:             FileInputStream     fis  = new FileInputStream(".");
   3:             System.out.println("1 FAIL! Should throw java.io.FileNotFoundException!");
   4:         ...
   5:             File                file = new File(".");
   6:             FileInputStream     fis  = new FileInputStream(file);
   7:             System.out.println("2 FAIL! Should throw java.io.FileNotFoundException!");
   8:         ...
   9:         {
  10:             FileInputStream     fis  = new FileInputStream(file);
  11:             System.out.println("5 Success.");

View Full Code Here
   1:       StreamTokenizer st = new StreamTokenizer(new 
   2:                                FileInputStream("./stream-tokenizer.data"));
   3: 
   4:       System.out.println("No tokens read: " + st.toString());
   5:       int j = 0;

View Full Code Here
   1:                     getSlideToken("root"), module.getPath() , "link_test.sxw",
   2:                     new FileInputStream("./test/data/link/link_test.sxw"));
   3: 
   4:         ...
   5:             action = ss.getWriteFile(getSlideToken("root"));
   6:             action.setContent(new FileInputStream("./test/data/link/test.jpg"));
   7:             action.setContentLength(new File("./test/data/link/test.jpg")
   8:                     .length());
   9:             action.setContentType("image/jpeg");

View Full Code Here
   1:     private Object readHandle() throws Exception {
   2:         ObjectInputStream in = new ObjectInputStream(new FileInputStream("../temp/" + this.getClass() + ".ser"));
   3:         Object handle = in.readObject();
   4:         in.close();
   5:         return handle;

View Full Code Here
   1:     private Object readHandle() throws Exception {
   2:         ObjectInputStream in = new ObjectInputStream(new FileInputStream("../temp/" + this.getClass() + ".ser"));
   3:         Object handle = in.readObject();
   4:         in.close();
   5:         return handle;

View Full Code Here

FileInputStream

public FileInputStream(String name)
            throws FileNotFoundException
Creates a FileInputStream by opening a connection to an actual file, the file named by the path name name in the file system. A new FileDescriptor object is created to represent this file connection.

First, if there is a security manager, its checkRead method is called with the name argument as its argument.

If the named file does not exist, is a directory rather than a regular file, or for some other reason cannot be opened for reading then a FileNotFoundException is thrown.

Parameters:
name - the system-dependent file name.
Throws:
FileNotFoundException - if the file does not exist, is a directory rather than a regular file, or for some other reason cannot be opened for reading.
SecurityException - if a security manager exists and its checkRead method denies read access to the file.
Usages and Demos :

View More Examples of FileInputStream(String name)
   1:         {
   2:             FileInputStream     fis  = new FileInputStream(".");
   3:             System.out.println("1 FAIL! Should throw java.io.FileNotFoundException!");
   4:         ...
   5:             File                file = new File(".");
   6:             FileInputStream     fis  = new FileInputStream(file);
   7:             System.out.println("2 FAIL! Should throw java.io.FileNotFoundException!");
   8:         ...
   9:         {
  10:             FileInputStream     fis  = new FileInputStream(file);
  11:             System.out.println("5 Success.");

View Full Code Here
   1:       StreamTokenizer st = new StreamTokenizer(new 
   2:                                FileInputStream("./stream-tokenizer.data"));
   3: 
   4:       System.out.println("No tokens read: " + st.toString());
   5:       int j = 0;

View Full Code Here
   1:                     getSlideToken("root"), module.getPath() , "link_test.sxw",
   2:                     new FileInputStream("./test/data/link/link_test.sxw"));
   3: 
   4:         ...
   5:             action = ss.getWriteFile(getSlideToken("root"));
   6:             action.setContent(new FileInputStream("./test/data/link/test.jpg"));
   7:             action.setContentLength(new File("./test/data/link/test.jpg")
   8:                     .length());
   9:             action.setContentType("image/jpeg");

View Full Code Here
   1:     private Object readHandle() throws Exception {
   2:         ObjectInputStream in = new ObjectInputStream(new FileInputStream("../temp/" + this.getClass() + ".ser"));
   3:         Object handle = in.readObject();
   4:         in.close();
   5:         return handle;

View Full Code Here
   1:     private Object readHandle() throws Exception {
   2:         ObjectInputStream in = new ObjectInputStream(new FileInputStream("../temp/" + this.getClass() + ".ser"));
   3:         Object handle = in.readObject();
   4:         in.close();
   5:         return handle;

View Full Code Here

Method Details

available

public int available()
            throws IOException
Returns the number of bytes that can be read from this file input stream without blocking.
Overrides:
available in interface InputStream
Returns:
the number of bytes that can be read from this file input stream without blocking.
Throws:
IOException - if an I/O error occurs.
Usages and Demos :

View More Examples of available()
   1: import java.io.File;
   2: import java.io.FileInputStream;
   3: import java.io.IOException;
   4:         ...
   5:     String r = null;
   6:     FileInputStream in = null;
   7:     try {
   8:         ...
   9:       in = new FileInputStream(_f);
  10:         ...
  11:       int l = in.available();

View Full Code Here
   1: {
   2:   System.out.println("Starting test of FileInputStream");
   3: 
   4:         ...
   5:     {
   6:       FileInputStream fis = new FileInputStream("/etc/services");
   7: 
   8:         ...
   9:       System.out.println("Available: " + fis.available());
  10:       System.out.println("FileDescriptor: " + fis.getFD());

View Full Code Here
   1: 
   2: import java.io.FileInputStream;
   3: import java.io.IOException;
   4:         ...
   5: 
   6:     protected FileInputStream in;
   7:     protected PageStore store;
   8:         ...
   9:         try {
  10:             in = new FileInputStream(Log.name(name));
  11:         } catch (IOException e) {
  12:         ...
  13:         try {
  14:             return in.available();

View Full Code Here
   1:     {
   2:       FileInputStream fis = new FileInputStream(queriesFile);
   3:       InputStreamReader isr = new InputStreamReader(fis);
   4:         ...
   5: 
   6:       int max = fis.available();
   7:       setMaxProgress(max);
   8:       startProgressThread();

View Full Code Here
   1:     System.out.println("FileServerPlugin::ConnectionEstablished");
   2:     FileInputStream fimage;
   3:     DataOutputStream dataout = null;
   4:         ...
   5:     {
   6:       fimage = new FileInputStream(filename);
   7:     }
   8:         ...
   9:     {
  10:       nbytes = fimage.available();
  11:     }

View Full Code Here

close

public void close()
            throws IOException
Closes this file input stream and releases any system resources associated with the stream.

If this stream has an associated channel then the channel is closed as well.

Specified by:
close in interface Closeable
Overrides:
close in interface InputStream
Throws:
IOException - if an I/O error occurs.
Usages and Demos :

View More Examples of close()
   1:   public static void main(String[] args) throws Exception {
   2:     FileInputStream file =
   3:         ...
   4:       new FileInputStream("MainException.java");
   5:         ...
   6:     file.close();
   7:   }

View Full Code Here
   1:     {
   2:         FileInputStream in = new FileInputStream("test");
   3:         ObjectInputStream s = new ObjectInputStream(in);
   4:         ...
   5:     System.out.print(date.toString());
   6:     in.close();
   7:         ...
   8:     s.close();
   9:     }

View Full Code Here
   1:                byte buffer[]=new byte[8];
   2:                     FileInputStream in = new FileInputStream("data.tmp");
   3:                 if ( in != null )
   4:         ...
   5:                    System.out.println( "read file data:" + str );
   6:                    in.close();
   7:                    }            
   8:                 }
   9:       }

View Full Code Here
   1:   public static void main(String args[]){
   2: FileInputStream in =new FileInputStream("c:\\java\\delttsul.exe");
   3:      FileOutputStream out=new FileOutputStream("c:\\java\\my.exe");
   4:         ...
   5:      System.out.println("file copyed and renamed");
   6:      in.close();;
   7:         ...
   8:      out.close();
   9:    }

View Full Code Here
   1: 
   2:         FileInputStream in = new FileInputStream(inputFile);
   3:         FileOutputStream out = new FileOutputStream(outputFile);
   4:         ...
   5: 
   6:         in.close();
   7:         ...
   8:         out.close();
   9:     }

View Full Code Here

finalize

protected void finalize()
            throws IOException
Ensures that the close method of this file input stream is called when there are no more references to it.
Overrides:
finalize in interface Object
Throws:
IOException - if an I/O error occurs.
See Also:
close()

getChannel

public FileChannel getChannel()
Returns the unique FileChannel object associated with this file input stream.

The initial position of the returned channel will be equal to the number of bytes read from the file so far. Reading bytes from this stream will increment the channel's position. Changing the channel's position, either explicitly or by reading, will change this stream's file position.

Returns:
the file channel associated with this file input stream
Since:
1.4
Usages and Demos :

View More Examples of getChannel()
   1: import java.io.IOException;
   2: import java.io.FileInputStream;
   3: import java.io.File;
   4:         ...
   5:     File aFile = new File("C:/Beg Java Stuff/charData.txt");
   6:     FileInputStream inFile = null;
   7:    
   8:         ...
   9:     try {
  10:       inFile = new FileInputStream(aFile); 
  11: 
  12:         ...
  13: 
  14:     FileChannel inChannel = inFile.getChannel();    

View Full Code Here
   1: 
   2:     FileInputStream fis = new FileInputStream(f);
   3:         ...
   4:     FileChannel fc = fis.getChannel();
   5: 
   6:     int sz = (int)fc.size();
   7:     MappedByteBuffer bb = fc.map(FileChannel.MAP_RO, 0, sz);

View Full Code Here
   1:     File aFile = new File("C:/Beg Java Stuff/primes.bin");
   2:     FileInputStream inFile = null;
   3:     FileOutputStream outFile = null;
   4:         ...
   5:     {
   6:       inFile = new FileInputStream(aFile); 
   7:     }
   8:         ...
   9:     }
  10:     FileChannel inChannel = inFile.getChannel();
  11:     

View Full Code Here
   1: import java.io.File;
   2: import java.io.FileInputStream;
   3: import java.io.IOException;
   4:         ...
   5:     File aFile = new File("C:/Beg Java Stuff/primes.bin");
   6:     FileInputStream inFile = null;
   7:    
   8:         ...
   9:     try {
  10:       inFile = new FileInputStream(aFile); 
  11: 
  12:         ...
  13:   
  14:     FileChannel inChannel = inFile.getChannel();    

View Full Code Here
   1: 
   2: import java.io.FileInputStream;
   3: import java.io.FileOutputStream;
   4:         ...
   5:       long start = System.currentTimeMillis();
   6:       FileInputStream in = new FileInputStream(args[0]);
   7:       FileOutputStream out = new FileOutputStream(args[1]);
   8:         ...
   9:       FileChannel inChannel = in.getChannel();
  10:         ...
  11:       FileChannel outChannel = out.getChannel();

View Full Code Here

getFD

public final FileDescriptor getFD()
            throws IOException
Returns the FileDescriptor object that represents the connection to the actual file in the file system being used by this FileInputStream.
Returns:
the file descriptor object associated with this stream.
Throws:
IOException - if an I/O error occurs.
Usages and Demos :

View More Examples of getFD()
   1: {
   2:   System.out.println("Starting test of FileInputStream");
   3: 
   4:         ...
   5:     {
   6:       FileInputStream fis = new FileInputStream("/etc/services");
   7: 
   8:         ...
   9:       System.out.println("Available: " + fis.available());
  10:       System.out.println("FileDescriptor: " + fis.getFD());
  11:       System.out.println("Dumping file. Note that first 100 bytes will be skipped");

View Full Code Here
   1:     Shuffler s = new Shuffler(args[0]) ;
   2:     FileInputStream f = new FileInputStream ("from") ;
   3:     FileOutputStream t = new FileOutputStream ("to") ;
   4:         ...
   5:     s.shuffle (f.getFD(), t.getFD()) ;
   6:     f.close() ;
   7:     t.close() ;
   8:     }

View Full Code Here

read

public int read()
            throws IOException
Reads a byte of data from this input stream. This method blocks if no input is yet available.
Overrides:
read in interface InputStream
Returns:
the next byte of data, or -1 if the end of the file is reached.
Throws:
IOException - if an I/O error occurs.
Usages and Demos :

View More Examples of read()
   1: import java.io.File;
   2: import java.io.FileInputStream;
   3: import java.io.IOException;
   4:         ...
   5:     FileChannel myChannel;
   6:     FileInputStream myFileStream;
   7:     
   8:         ...
   9:     public SVNInputFileChannel(File file) throws FileNotFoundException {
  10:         myFileStream = new FileInputStream(file); 
  11:         myChannel = myFileStream.getChannel();

View Full Code Here
   1:   public int getNextByte() throws java.io.IOException {
   2:     return _input.read();
   3:   }
   4:         ...
   5:     try {
   6:       FileInputStream file = new FileInputStream(args[0]);
   7:       try {
   8:         ...
   9:     int k1 = file.read();
  10:     long start = System.currentTimeMillis();
  11:         ...
  12:     System.out.println("index1 = " + concepts.cardinality());
  13:     int k2 = file.read();

View Full Code Here
   1:                 {
   2:                     FileInputStream fis = new FileInputStream(f);
   3:         ...
   4:                     fis.read();
   5:                     fis.close();
   6:                     break;
   7:                 }

View Full Code Here
   1:             PGPDSA dsa = new PGPDSA();
   2:             FileInputStream fis = new FileInputStream(path+"seckey.dat");
   3:             dsa.decodePublicData(new PGPWrapperDataInputStream(fis));
   4:         ...
   5:         beginTest("Read and hash testdata");
   6:             fis = new FileInputStream(path+"test");
   7:             MessageDigest md = (new PGPAlgorithmFactory()).getHashAlgorithm(2);
   8:         ...
   9:             while (fis.available() > 0) {
  10:                 md.update((byte)fis.read());
  11:             }
  12:         ...
  13:             while (fis.available() > 0) {
  14:                 dsa.update((byte)fis.read());

View Full Code Here
   1: import java.io.File;
   2: import java.io.FileInputStream;
   3: import java.io.FileOutputStream;
   4:         ...
   5:         ReplayInputStream ris = ros.getReplayInputStream();
   6:         ris.read();
   7:         ...
   8:         ris.read();
   9:         ris.reset();
  10:         ...
  11:         assertEquals("Reset to zero char 3", ris.read(), 3);

View Full Code Here

read

public int read(b[] )
            throws IOException
Reads up to b.length bytes of data from this input stream into an array of bytes. This method blocks until some input is available.
Overrides:
read in interface InputStream
Parameters:
Returns:
the total number of bytes read into the buffer, or -1 if there is no more data because the end of the file has been reached.
Throws:
IOException - if an I/O error occurs.
Usages and Demos :

View More Examples of read(b[] )
   1:                byte buffer[]=new byte[8];
   2:                     FileInputStream in = new FileInputStream("data.tmp");
   3:                 if ( in != null )
   4:         ...
   5:                 {
   6:                    in.read( buffer );
   7:                    String str = new String( buffer,0 );
   8:                    System.out.println( "read file data:" + str );
   9:                    in.close();

View Full Code Here
   1:   public static void main(String args[]){
   2: FileInputStream in =new FileInputStream("c:\\java\\delttsul.exe");
   3:      FileOutputStream out=new FileOutputStream("c:\\java\\my.exe");
   4:         ...
   5:      byte b[]=new byte[in.available()];
   6:      in.read(b);
   7:      out.write(b);
   8:      System.out.println("file copyed and renamed");
   9:      in.close();;

View Full Code Here
   1:       File inFile = new File("sample1.data");
   2:       FileInputStream inStream = new FileInputStream(inFile);
   3: 
   4:         ...
   5: 
   6:       inStream.read(byteArray);
   7:       for (int i = 0; i < fileSize; i++) {
   8:          outputBox.printLine(byteArray[i]);
   9:       }

View Full Code Here
   1:             byte[] b = new byte[(int) f.length()];
   2:             FileInputStream fis = new FileInputStream(f);
   3:         ...
   4:             fis.read(b);
   5:             return defineClass(navn, b, 0, b.length);
   6:         } catch (Exception e) {
   7:             System.out.println("findClass() fejl:"+e.getMessage());

View Full Code Here
   1: import java.io.File;
   2: import java.io.FileInputStream;
   3: import java.io.IOException;
   4:         ...
   5:     protected static String FileToString(File file) throws IOException {
   6:         FileInputStream fileInput = new FileInputStream(file);
   7:         byte[] b = new byte[fileInput.available()];
   8:         ...
   9:         fileInput.read(b);
  10:         fileInput.close();

View Full Code Here

read

public int read(b[] ,
                int off,
                int len)
            throws IOException
Reads up to len bytes of data from this input stream into an array of bytes. This method blocks until some input is available.
Overrides:
read in interface InputStream
Parameters:
off - the start offset of the data.
len - the maximum number of bytes read.
Returns:
the total number of bytes read into the buffer, or -1 if there is no more data because the end of the file has been reached.
Throws:
IOException - if an I/O error occurs.
Usages and Demos :

View More Examples of read(b[] ,int off,int len)
   1: import java.io.File;
   2: import java.io.FileInputStream;
   3: import java.io.IOException;
   4:         ...
   5:     String r = null;
   6:     FileInputStream in = null;
   7:     try {
   8:         ...
   9:       in = new FileInputStream(_f);
  10:       int l = in.available();
  11:         ...
  12:       byte[] bs = new byte[l];
  13:       in.read(bs, 0, l);

View Full Code Here
   1: import java.io.File;
   2: import java.io.FileInputStream;
   3: import java.io.IOException;
   4:         ...
   5:     FileChannel myChannel;
   6:     FileInputStream myFileStream;
   7:     
   8:         ...
   9:     public SVNInputFileChannel(File file) throws FileNotFoundException {
  10:         myFileStream = new FileInputStream(file); 
  11:         myChannel = myFileStream.getChannel();
  12:         ...
  13:     public int read(byte[] b, int off, int len) throws IOException {
  14:         return myChannel.read(ByteBuffer.wrap(b, off, len));

View Full Code Here
   1: import java.io.File;
   2: import java.io.FileInputStream;
   3: import java.io.FileNotFoundException;
   4:         ...
   5:         String path = getThumbnailPath(thumbnail.getId());
   6:         FileInputStream stream = new FileInputStream(path);
   7:         ...
   8:         stream.read(buf, 0, buf.length);
   9:         stream.close();

View Full Code Here
   1: import java.awt.image.MemoryImageSource;
   2: import java.io.FileInputStream;
   3: import java.io.IOException;
   4:         ...
   5: 
   6:     public void read (final FileInputStream fs)
   7:             throws IOException
   8:         ...
   9:       final byte[] bf = new byte[bflen];
  10:       fs.read(bf, 0, bflen);
  11:       final byte[] bi = new byte[bilen];
  12:         ...
  13:       fs.read(bi, 0, bilen);

View Full Code Here
   1:         try {
   2:             FileInputStream scan = new FileInputStream(bfile);
   3:         ...
   4:             scan.read(buffer, 0, filesize);
   5:             scan.close();
   6:         } catch (FileNotFoundException e) {
   7:             log.error("error getfile : " + filename + " " + Logging.stackTrace(e));

View Full Code Here

skip

public long skip(long n)
            throws IOException
Skips over and discards n bytes of data from the input stream.

The skip method may, for a variety of reasons, end up skipping over some smaller number of bytes, possibly 0. If n is negative, an IOException is thrown, even though the skip method of the InputStream superclass does nothing in this case. The actual number of bytes skipped is returned.

This method may skip more bytes than are remaining in the backing file. This produces no exception and the number of bytes skipped may include some number of bytes that were beyond the EOF of the backing file. Attempting to read from the stream after skipping past the end will result in -1 indicating the end of the file.

Overrides:
skip in interface InputStream
Parameters:
n - the number of bytes to be skipped.
Returns:
the actual number of bytes skipped.
Throws:
IOException - if n is negative, or if an I/O error occurs.
Usages and Demos :

View More Examples of skip(long n)
   1: {
   2:   System.out.println("Starting test of FileInputStream");
   3: 
   4:         ...
   5:     {
   6:       FileInputStream fis = new FileInputStream("/etc/services");
   7: 
   8:         ...
   9:       System.out.println("Dumping file. Note that first 100 bytes will be skipped");
  10:       fis.skip(100);

View Full Code Here
   1: import java.io.IOException;
   2: import java.io.FileInputStream;
   3: 
   4:         ...
   5:       byte[] id3Infos = new byte[128];
   6:       FileInputStream fis = null;
   7:       try
   8:         ...
   9:       {
  10:          fis = new FileInputStream(mp3);
  11:         ...
  12:          fis.skip(mp3.length() - 128);

View Full Code Here
   1: 
   2: import java.io.FileInputStream;
   3: import java.io.IOException;
   4:         ...
   5: 
   6:   private FileInputStream _is;
   7: 
   8:         ...
   9:   
  10:   public FileReadStream(FileInputStream is)
  11:   {
  12:         ...
  13:     if (_is != null)
  14:       return _is.skip(n);

View Full Code Here
   1: import java.io.OutputStream;
   2: import java.io.FileInputStream;
   3: import java.io.IOException;
   4:         ...
   5: import java.io.FileInputStream;
   6: 
   7:         ...
   8:   {
   9:     FileInputStream fin = null;
  10:     private long bytes_read = 0;
  11:         ...
  12:         {
  13:           fin.skip(skipped);

View Full Code Here
   1:     
   2:     FileInputStream fis = new FileInputStream(new File(testdir, "TestDSA1.dat") );
   3:         ...
   4:     fis.skip(9);
   5:     PGPDSA dsa = new PGPDSA();
   6:     dsa.decodePublicData(new PGPWrapperDataInputStream(fis));
   7:     assertTrue(true);

View Full Code Here