Top Description Fields Constructors Methods
liquibase.util

public Class BomAwareInputStream

extends PushbackInputStream
Class Inheritance
Imports
java.io.IOException, .InputStream, .PushbackInputStream, java.nio.charset.Charset, .StandardCharsets

Read up to 4 bytes to determine the BOM. Extra bytes, of if no BOM is found are pushed back to the input stream. If no BOM is found, the detectedCharsetName is null.

Field Summary

Modifier and TypeField and Description
private static final byte
private static final byte
private static final byte
private static final byte
private static final byte
private static final byte
private Charset
Inherited from java.io.PushbackInputStream:
bufpos

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Charset

Returns:

charset name - one of UTF-8, UTF-16BE, UTF-32LE, UTF-16LE, UTF-32BE or null if no BOM detected
getDetectedCharset
()

Returns detected charset name.

protected void
init()

Inherited from java.io.PushbackInputStream:
availableclosemarkmarkSupportedreadreadresetskiptransferTounreadunreadunread

Field Detail

_0x00back to summary
private static final byte _0x00
_0xBBback to summary
private static final byte _0xBB
_0xBFback to summary
private static final byte _0xBF
_0xEFback to summary
private static final byte _0xEF
_0xFEback to summary
private static final byte _0xFE
_0xFFback to summary
private static final byte _0xFF
detectedCharsetback to summary
private Charset detectedCharset

Constructor Detail

BomAwareInputStreamback to summary
public BomAwareInputStream(InputStream in) throws IOException

Method Detail

getDetectedCharsetback to summary
public Charset getDetectedCharset()

Returns detected charset name. Null if no BOM header was found.

Returns:Charset

charset name - one of UTF-8, UTF-16BE, UTF-32LE, UTF-16LE, UTF-32BE or null if no BOM detected

initback to summary
protected void init() throws IOException