com.wewebu.ow.server.util
Class OwUnicodeInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by com.wewebu.ow.server.util.OwUnicodeInputStream
All Implemented Interfaces:
Closeable

public class OwUnicodeInputStream
extends InputStream

Class OwUnicodeInputStream.
The class recognize unicode BOM marks and will skip bytes:

    
  • 00 00 FE FF = UTF-32, big-endian
  • FF FE 00 00 = UTF-32, little-endian
  • EF BB BF = UTF-8
  • FE FF = UTF-16, big-endian
  • FF FE = UTF-16, little-endian
  • Alfresco Workdesk
    Copyright (c) Alfresco Software, Inc.
    All rights reserved.

    For licensing information read the license.txt file or
    go to: http://wiki.alfresco.com


    Method Summary
     void close()
               
     String getDefaultEncoding()
               
     String getEncoding()
               
    protected  void init()
              Read-ahead four bytes and check for BOM marks.
     int read()
               
     
    Methods inherited from class java.io.InputStream
    available, mark, markSupported, read, read, reset, skip
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Method Detail

    getDefaultEncoding

    public String getDefaultEncoding()
    Returns:
    String defaultEncodinf

    getEncoding

    public String getEncoding()
    Returns:
    String encoding

    init

    protected void init()
                 throws IOException
    Read-ahead four bytes and check for BOM marks. Extra bytes are unread back to the stream, only BOM bytes are skipped.

    Throws:
    IOException

    close

    public void close()
               throws IOException
    Specified by:
    close in interface Closeable
    Overrides:
    close in class InputStream
    Throws:
    IOException

    read

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


    Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.