Java Code Examples for com.sun.xml.internal.stream.util.BufferAllocator#getByteBuffer()
The following examples show how to use
com.sun.xml.internal.stream.util.BufferAllocator#getByteBuffer() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ASCIIReader.java From JDKSourceCode1.8 with MIT License | 5 votes |
/** * Constructs an ASCII reader from the specified input stream * and buffer size. * * @param inputStream The input stream. * @param size The initial buffer size. * @param messageFormatter the MessageFormatter to use to message reporting. * @param locale the Locale for which messages are to be reported */ public ASCIIReader(InputStream inputStream, int size, MessageFormatter messageFormatter, Locale locale) { fInputStream = inputStream; BufferAllocator ba = ThreadLocalBufferAllocator.getBufferAllocator(); fBuffer = ba.getByteBuffer(size); if (fBuffer == null) { fBuffer = new byte[size]; } fFormatter = messageFormatter; fLocale = locale; }
Example 2
Source File: ASCIIReader.java From Bytecoder with Apache License 2.0 | 5 votes |
/** * Constructs an ASCII reader from the specified input stream * and buffer size. * * @param inputStream The input stream. * @param size The initial buffer size. * @param messageFormatter the MessageFormatter to use to message reporting. * @param locale the Locale for which messages are to be reported */ public ASCIIReader(InputStream inputStream, int size, MessageFormatter messageFormatter, Locale locale) { fInputStream = inputStream; BufferAllocator ba = ThreadLocalBufferAllocator.getBufferAllocator(); fBuffer = ba.getByteBuffer(size); if (fBuffer == null) { fBuffer = new byte[size]; } fFormatter = messageFormatter; fLocale = locale; }
Example 3
Source File: ASCIIReader.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * Constructs an ASCII reader from the specified input stream * and buffer size. * * @param inputStream The input stream. * @param size The initial buffer size. * @param messageFormatter the MessageFormatter to use to message reporting. * @param locale the Locale for which messages are to be reported */ public ASCIIReader(InputStream inputStream, int size, MessageFormatter messageFormatter, Locale locale) { fInputStream = inputStream; BufferAllocator ba = ThreadLocalBufferAllocator.getBufferAllocator(); fBuffer = ba.getByteBuffer(size); if (fBuffer == null) { fBuffer = new byte[size]; } fFormatter = messageFormatter; fLocale = locale; }
Example 4
Source File: UCSReader.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * Constructs an ASCII reader from the specified input stream * and buffer size. The Endian-ness and whether this is * UCS-2 or UCS-4 needs also to be known in advance. * * @param inputStream The input stream. * @param size The initial buffer size. * @param encoding One of UCS2LE, UCS2BE, UCS4LE or UCS4BE. */ public UCSReader(InputStream inputStream, int size, short encoding) { fInputStream = inputStream; BufferAllocator ba = ThreadLocalBufferAllocator.getBufferAllocator(); fBuffer = ba.getByteBuffer(size); if (fBuffer == null) { fBuffer = new byte[size]; } fEncoding = encoding; }
Example 5
Source File: UCSReader.java From Bytecoder with Apache License 2.0 | 5 votes |
/** * Constructs an ASCII reader from the specified input stream * and buffer size. The Endian-ness and whether this is * UCS-2 or UCS-4 needs also to be known in advance. * * @param inputStream The input stream. * @param size The initial buffer size. * @param encoding One of UCS2LE, UCS2BE, UCS4LE or UCS4BE. */ public UCSReader(InputStream inputStream, int size, short encoding) { fInputStream = inputStream; BufferAllocator ba = ThreadLocalBufferAllocator.getBufferAllocator(); fBuffer = ba.getByteBuffer(size); if (fBuffer == null) { fBuffer = new byte[size]; } fEncoding = encoding; }
Example 6
Source File: UCSReader.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * Constructs an ASCII reader from the specified input stream * and buffer size. The Endian-ness and whether this is * UCS-2 or UCS-4 needs also to be known in advance. * * @param inputStream The input stream. * @param size The initial buffer size. * @param encoding One of UCS2LE, UCS2BE, UCS4LE or UCS4BE. */ public UCSReader(InputStream inputStream, int size, short encoding) { fInputStream = inputStream; BufferAllocator ba = ThreadLocalBufferAllocator.getBufferAllocator(); fBuffer = ba.getByteBuffer(size); if (fBuffer == null) { fBuffer = new byte[size]; } fEncoding = encoding; }
Example 7
Source File: UCSReader.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * Constructs an ASCII reader from the specified input stream * and buffer size. The Endian-ness and whether this is * UCS-2 or UCS-4 needs also to be known in advance. * * @param inputStream The input stream. * @param size The initial buffer size. * @param encoding One of UCS2LE, UCS2BE, UCS4LE or UCS4BE. */ public UCSReader(InputStream inputStream, int size, short encoding) { fInputStream = inputStream; BufferAllocator ba = ThreadLocalBufferAllocator.getBufferAllocator(); fBuffer = ba.getByteBuffer(size); if (fBuffer == null) { fBuffer = new byte[size]; } fEncoding = encoding; }
Example 8
Source File: UCSReader.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * Constructs an ASCII reader from the specified input stream * and buffer size. The Endian-ness and whether this is * UCS-2 or UCS-4 needs also to be known in advance. * * @param inputStream The input stream. * @param size The initial buffer size. * @param encoding One of UCS2LE, UCS2BE, UCS4LE or UCS4BE. */ public UCSReader(InputStream inputStream, int size, short encoding) { fInputStream = inputStream; BufferAllocator ba = ThreadLocalBufferAllocator.getBufferAllocator(); fBuffer = ba.getByteBuffer(size); if (fBuffer == null) { fBuffer = new byte[size]; } fEncoding = encoding; }
Example 9
Source File: UTF8Reader.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * Constructs a UTF-8 reader from the specified input stream, * buffer size and MessageFormatter. * * @param inputStream The input stream. * @param size The initial buffer size. * @param messageFormatter the formatter for localizing/formatting errors. * @param locale the Locale to use for messages */ public UTF8Reader(InputStream inputStream, int size, MessageFormatter messageFormatter, Locale locale) { fInputStream = inputStream; BufferAllocator ba = ThreadLocalBufferAllocator.getBufferAllocator(); fBuffer = ba.getByteBuffer(size); if (fBuffer == null) { fBuffer = new byte[size]; } fFormatter = messageFormatter; fLocale = locale; }
Example 10
Source File: UCSReader.java From JDKSourceCode1.8 with MIT License | 5 votes |
/** * Constructs an ASCII reader from the specified input stream * and buffer size. The Endian-ness and whether this is * UCS-2 or UCS-4 needs also to be known in advance. * * @param inputStream The input stream. * @param size The initial buffer size. * @param encoding One of UCS2LE, UCS2BE, UCS4LE or UCS4BE. */ public UCSReader(InputStream inputStream, int size, short encoding) { fInputStream = inputStream; BufferAllocator ba = ThreadLocalBufferAllocator.getBufferAllocator(); fBuffer = ba.getByteBuffer(size); if (fBuffer == null) { fBuffer = new byte[size]; } fEncoding = encoding; }
Example 11
Source File: ASCIIReader.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * Constructs an ASCII reader from the specified input stream * and buffer size. * * @param inputStream The input stream. * @param size The initial buffer size. * @param messageFormatter the MessageFormatter to use to message reporting. * @param locale the Locale for which messages are to be reported */ public ASCIIReader(InputStream inputStream, int size, MessageFormatter messageFormatter, Locale locale) { fInputStream = inputStream; BufferAllocator ba = ThreadLocalBufferAllocator.getBufferAllocator(); fBuffer = ba.getByteBuffer(size); if (fBuffer == null) { fBuffer = new byte[size]; } fFormatter = messageFormatter; fLocale = locale; }
Example 12
Source File: UTF8Reader.java From JDKSourceCode1.8 with MIT License | 5 votes |
/** * Constructs a UTF-8 reader from the specified input stream, * buffer size and MessageFormatter. * * @param inputStream The input stream. * @param size The initial buffer size. * @param messageFormatter the formatter for localizing/formatting errors. * @param locale the Locale to use for messages */ public UTF8Reader(InputStream inputStream, int size, MessageFormatter messageFormatter, Locale locale) { fInputStream = inputStream; BufferAllocator ba = ThreadLocalBufferAllocator.getBufferAllocator(); fBuffer = ba.getByteBuffer(size); if (fBuffer == null) { fBuffer = new byte[size]; } fFormatter = messageFormatter; fLocale = locale; }
Example 13
Source File: ASCIIReader.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * Constructs an ASCII reader from the specified input stream * and buffer size. * * @param inputStream The input stream. * @param size The initial buffer size. * @param messageFormatter the MessageFormatter to use to message reporting. * @param locale the Locale for which messages are to be reported */ public ASCIIReader(InputStream inputStream, int size, MessageFormatter messageFormatter, Locale locale) { fInputStream = inputStream; BufferAllocator ba = ThreadLocalBufferAllocator.getBufferAllocator(); fBuffer = ba.getByteBuffer(size); if (fBuffer == null) { fBuffer = new byte[size]; } fFormatter = messageFormatter; fLocale = locale; }
Example 14
Source File: ASCIIReader.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * Constructs an ASCII reader from the specified input stream * and buffer size. * * @param inputStream The input stream. * @param size The initial buffer size. * @param messageFormatter the MessageFormatter to use to message reporting. * @param locale the Locale for which messages are to be reported */ public ASCIIReader(InputStream inputStream, int size, MessageFormatter messageFormatter, Locale locale) { fInputStream = inputStream; BufferAllocator ba = ThreadLocalBufferAllocator.getBufferAllocator(); fBuffer = ba.getByteBuffer(size); if (fBuffer == null) { fBuffer = new byte[size]; } fFormatter = messageFormatter; fLocale = locale; }
Example 15
Source File: UTF8Reader.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * Constructs a UTF-8 reader from the specified input stream, * buffer size and MessageFormatter. * * @param inputStream The input stream. * @param size The initial buffer size. * @param messageFormatter the formatter for localizing/formatting errors. * @param locale the Locale to use for messages */ public UTF8Reader(InputStream inputStream, int size, MessageFormatter messageFormatter, Locale locale) { fInputStream = inputStream; BufferAllocator ba = ThreadLocalBufferAllocator.getBufferAllocator(); fBuffer = ba.getByteBuffer(size); if (fBuffer == null) { fBuffer = new byte[size]; } fFormatter = messageFormatter; fLocale = locale; }
Example 16
Source File: UCSReader.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * Constructs an ASCII reader from the specified input stream * and buffer size. The Endian-ness and whether this is * UCS-2 or UCS-4 needs also to be known in advance. * * @param inputStream The input stream. * @param size The initial buffer size. * @param encoding One of UCS2LE, UCS2BE, UCS4LE or UCS4BE. */ public UCSReader(InputStream inputStream, int size, short encoding) { fInputStream = inputStream; BufferAllocator ba = ThreadLocalBufferAllocator.getBufferAllocator(); fBuffer = ba.getByteBuffer(size); if (fBuffer == null) { fBuffer = new byte[size]; } fEncoding = encoding; }
Example 17
Source File: ASCIIReader.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * Constructs an ASCII reader from the specified input stream * and buffer size. * * @param inputStream The input stream. * @param size The initial buffer size. * @param messageFormatter the MessageFormatter to use to message reporting. * @param locale the Locale for which messages are to be reported */ public ASCIIReader(InputStream inputStream, int size, MessageFormatter messageFormatter, Locale locale) { fInputStream = inputStream; BufferAllocator ba = ThreadLocalBufferAllocator.getBufferAllocator(); fBuffer = ba.getByteBuffer(size); if (fBuffer == null) { fBuffer = new byte[size]; } fFormatter = messageFormatter; fLocale = locale; }
Example 18
Source File: UTF8Reader.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * Constructs a UTF-8 reader from the specified input stream, * buffer size and MessageFormatter. * * @param inputStream The input stream. * @param size The initial buffer size. * @param messageFormatter the formatter for localizing/formatting errors. * @param locale the Locale to use for messages */ public UTF8Reader(InputStream inputStream, int size, MessageFormatter messageFormatter, Locale locale) { fInputStream = inputStream; BufferAllocator ba = ThreadLocalBufferAllocator.getBufferAllocator(); fBuffer = ba.getByteBuffer(size); if (fBuffer == null) { fBuffer = new byte[size]; } fFormatter = messageFormatter; fLocale = locale; }
Example 19
Source File: UCSReader.java From jdk1.8-source-analysis with Apache License 2.0 | 5 votes |
/** * Constructs an ASCII reader from the specified input stream * and buffer size. The Endian-ness and whether this is * UCS-2 or UCS-4 needs also to be known in advance. * * @param inputStream The input stream. * @param size The initial buffer size. * @param encoding One of UCS2LE, UCS2BE, UCS4LE or UCS4BE. */ public UCSReader(InputStream inputStream, int size, short encoding) { fInputStream = inputStream; BufferAllocator ba = ThreadLocalBufferAllocator.getBufferAllocator(); fBuffer = ba.getByteBuffer(size); if (fBuffer == null) { fBuffer = new byte[size]; } fEncoding = encoding; }
Example 20
Source File: ASCIIReader.java From jdk1.8-source-analysis with Apache License 2.0 | 5 votes |
/** * Constructs an ASCII reader from the specified input stream * and buffer size. * * @param inputStream The input stream. * @param size The initial buffer size. * @param messageFormatter the MessageFormatter to use to message reporting. * @param locale the Locale for which messages are to be reported */ public ASCIIReader(InputStream inputStream, int size, MessageFormatter messageFormatter, Locale locale) { fInputStream = inputStream; BufferAllocator ba = ThreadLocalBufferAllocator.getBufferAllocator(); fBuffer = ba.getByteBuffer(size); if (fBuffer == null) { fBuffer = new byte[size]; } fFormatter = messageFormatter; fLocale = locale; }