de.michab.simulator.mos6502.c64
Class SystemFile

java.lang.Object
  extended byde.michab.simulator.mos6502.c64.SystemFile

public class SystemFile
extends java.lang.Object

Represents a file system file object. This is a value object used as a file abstraction that can be used also in a WebStart environment.

Version:
$Revision: 1.7 $

Constructor Summary
SystemFile(java.io.File file)
          Convenience constructor.
SystemFile(java.lang.String name, java.io.InputStream is)
          Create a system file.
SystemFile(java.lang.String name, java.io.InputStream is, int size)
          Create a system file.
 
Method Summary
 byte[] getContent()
          Get the file's content.
 int getLength()
          Get the length of the system file.
 java.lang.String getName()
          Returns the name of this system file for display purposes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemFile

public SystemFile(java.io.File file)
           throws java.io.IOException
Convenience constructor.

Parameters:
file - The file to read from.

SystemFile

public SystemFile(java.lang.String name,
                  java.io.InputStream is)
           throws java.io.IOException
Create a system file. Note that this is less efficient than the constructor offering also a size argument.

Parameters:
name - The name to be displayed.
is - An input stream used for reading the content.
Throws:
java.io.IOException - In case of io errors.
See Also:
SystemFile(String, InputStream, int)

SystemFile

public SystemFile(java.lang.String name,
                  java.io.InputStream is,
                  int size)
           throws java.io.IOException
Create a system file.

Parameters:
name - The name to be displayed.
is - An input stream used for reading the content.
size - The expected number of bytes to be read.
Throws:
java.io.IOException - In case of io errors.
See Also:
SystemFile(String, InputStream )
Method Detail

getName

public java.lang.String getName()
Returns the name of this system file for display purposes.


getLength

public int getLength()
Get the length of the system file.


getContent

public byte[] getContent()
Get the file's content.