public class

UnicodeReader

extends Reader
java.lang.Object
   ↳ java.io.Reader
     ↳ com.google.gdata.util.io.base.UnicodeReader

Class Overview

Generic Unicode text reader, which uses a BOM (Byte Order Mark) to identify the encoding to be used. This also has the side effect of removing the BOM from the input stream (when present).

Summary

Constants
int BOM_SIZE
[Expand]
Inherited Constants
From class java.io.Reader
Fields
private final String defaultEnc
private final InputStreamReader internalInputStreamReader
[Expand]
Inherited Fields
From class java.io.Reader
Public Constructors
UnicodeReader(InputStream in, String defaultEnc)
Public Methods
void close()
String getDefaultEncoding()
String getEncoding()
int read(char[] cbuf, int off, int len)
[Expand]
Inherited Methods
From class java.io.Reader
From class java.lang.Object
From interface java.io.Closeable
From interface java.lang.Readable

Constants

private static final int BOM_SIZE

Constant Value: 4 (0x00000004)

Fields

private final String defaultEnc

private final InputStreamReader internalInputStreamReader

Public Constructors

public UnicodeReader (InputStream in, String defaultEnc)

Parameters
in Input stream
defaultEnc Default encoding (used only if BOM is not found) or null to use system default
Throws
IOException if an I/O error occurs

Public Methods

public void close ()

Throws
IOException

public String getDefaultEncoding ()

public String getEncoding ()

public int read (char[] cbuf, int off, int len)

Parameters
cbuf
off
len
Throws
IOException