com.atlassian.jira.util.xml
Class JiraFileInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by com.atlassian.jira.util.xml.JiraFileInputStream
All Implemented Interfaces:
Closeable

public class JiraFileInputStream
extends InputStream

An input streams that handles Unicode Byte-Order Mark (BOM) marker within a normal file as well as a ZIP file. Distilled and adapted from http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6206835


Field Summary
static byte[][] BOMBYTES
           
static int MAXBOMBYTES
          No bom sequence is longer than 4 bytes
static int NONE
           
static byte[] UTF16BEBOMBYTES
           
static byte[] UTF16LEBOMBYTES
           
static byte[] UTF32BEBOMBYTES
           
static byte[] UTF32LEBOMBYTES
           
static byte[] UTF8BOMBYTES
           
 
Constructor Summary
JiraFileInputStream(File file)
           
 
Method Summary
 long getSize()
           
 int read()
           
 int read(byte[] b, int off, int len)
           
 
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UTF32BEBOMBYTES

public static final byte[] UTF32BEBOMBYTES

UTF32LEBOMBYTES

public static final byte[] UTF32LEBOMBYTES

UTF16BEBOMBYTES

public static final byte[] UTF16BEBOMBYTES

UTF16LEBOMBYTES

public static final byte[] UTF16LEBOMBYTES

UTF8BOMBYTES

public static final byte[] UTF8BOMBYTES

BOMBYTES

public static final byte[][] BOMBYTES

NONE

public static final int NONE
See Also:
Constant Field Values

MAXBOMBYTES

public static final int MAXBOMBYTES
No bom sequence is longer than 4 bytes

See Also:
Constant Field Values
Constructor Detail

JiraFileInputStream

public JiraFileInputStream(File file)
                    throws IOException,
                           FileNotFoundException
Throws:
IOException
FileNotFoundException
Method Detail

read

public int read()
         throws IOException
Specified by:
read in class InputStream
Throws:
IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException

getSize

public long getSize()


Copyright © 2002-2012 Atlassian. All Rights Reserved.