[102915] Need manifest directive for our content Describers
diff --git a/bundles/org.eclipse.jst.jsp.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.jst.jsp.core/META-INF/MANIFEST.MF
index baece32..d1519c3 100644
--- a/bundles/org.eclipse.jst.jsp.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.jst.jsp.core/META-INF/MANIFEST.MF
@@ -41,4 +41,4 @@
org.eclipse.wst.common.uriresolver,
org.eclipse.wst.validation,
org.eclipse.tomcat;resolution:=optional
-Eclipse-AutoStart: true
+Eclipse-AutoStart: true; exceptions="org.eclipse.jst.jsp.core.internal.contenttype"
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/ByteReader.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/ByteReader.java
new file mode 100644
index 0000000..681b089
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/ByteReader.java
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Jens Lukowski/Innoopract - initial renaming/restructuring
+ *
+ *******************************************************************************/
+package org.eclipse.jst.jsp.core.internal.contenttype;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+
+import org.eclipse.wst.sse.core.internal.encoding.CodedIO;
+
+/**
+ * This is an "adapter" class, simply to get in input stream to act like a
+ * reader. We could not use InputStreamReader directly because its internal
+ * buffers are not controllable, and it sometimes pulls too much out of input
+ * stream (even when it wasn't needed for our purposes).
+ *
+ * The use of this class is highly specialized and by not means meant to be
+ * general purpose. Its use is restricted to those cases where the input
+ * stream can be regarded as ascii just long enough to determine what the real
+ * encoding should be.
+ */
+
+public class ByteReader extends Reader {
+
+
+ public static final int DEFAULT_BUFFER_SIZE = CodedIO.MAX_BUF_SIZE;
+
+ protected byte[] fBuffer;
+
+ protected InputStream fInputStream;
+
+ protected ByteReader() {
+ super();
+ }
+
+ public ByteReader(InputStream inputStream) {
+ this(inputStream, DEFAULT_BUFFER_SIZE);
+ if (!inputStream.markSupported()) {
+ throw new IllegalArgumentException("ByteReader is required to have a resettable stream"); //$NON-NLS-1$
+ }
+ }
+
+ public ByteReader(InputStream inputStream, int size) {
+ this.fInputStream = inputStream;
+ if (!inputStream.markSupported()) {
+ throw new IllegalArgumentException("ByteReader is required to have a resettable stream"); //$NON-NLS-1$
+ }
+ this.fBuffer = new byte[size];
+
+ }
+
+ public void close() throws IOException {
+ this.fInputStream.close();
+ }
+
+ public void mark(int readAheadLimit) {
+ this.fInputStream.mark(readAheadLimit);
+ }
+
+ public boolean markSupported() {
+ return true;
+ }
+
+ public int read() throws IOException {
+ int b0 = this.fInputStream.read();
+ return (b0 & 0x00FF);
+ }
+
+ public int read(char ch[], int offset, int length) throws IOException {
+ if (length > this.fBuffer.length) {
+ length = this.fBuffer.length;
+ }
+
+ int count = this.fInputStream.read(this.fBuffer, 0, length);
+
+ for (int i = 0; i < count; i++) {
+ int b0 = this.fBuffer[i];
+ // the 0x00FF is to "lose" the negative bits filled in the byte to
+ // int conversion
+ // (and which would be there if cast directly from byte to char).
+ char c0 = (char) (b0 & 0x00FF);
+ ch[offset + i] = c0;
+ }
+ return count;
+ }
+
+ public boolean ready() throws IOException {
+ return this.fInputStream.available() > 0;
+ }
+
+ public void reset() throws IOException {
+ this.fInputStream.reset();
+ }
+
+ public long skip(long n) throws IOException {
+ return this.fInputStream.skip(n);
+ }
+
+}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPResourceEncodingDetector.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPResourceEncodingDetector.java
index 3beae68..105980e 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPResourceEncodingDetector.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPResourceEncodingDetector.java
@@ -26,7 +26,6 @@
import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
import org.eclipse.wst.sse.core.internal.encoding.IResourceCharsetDetector;
import org.eclipse.wst.sse.core.internal.encoding.NonContentBasedEncodingRules;
-import org.eclipse.wst.sse.core.internal.encoding.util.ByteReader;
import org.eclipse.wst.xml.core.internal.contenttype.EncodingParserConstants;
import org.eclipse.wst.xml.core.internal.contenttype.XMLHeadTokenizerConstants;
diff --git a/bundles/org.eclipse.wst.css.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.css.core/META-INF/MANIFEST.MF
index 7801595..f051559 100644
--- a/bundles/org.eclipse.wst.css.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.css.core/META-INF/MANIFEST.MF
@@ -38,4 +38,4 @@
org.eclipse.wst.sse.ui,
org.eclipse.wst.xml.core,
org.eclipse.wst.sse.core
-Eclipse-AutoStart: true
+Eclipse-AutoStart: true; exceptions="org.eclipse.wst.css.core.internal.contenttype"
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/ByteReader.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/ByteReader.java
new file mode 100644
index 0000000..506cc1f
--- /dev/null
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/ByteReader.java
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Jens Lukowski/Innoopract - initial renaming/restructuring
+ *
+ *******************************************************************************/
+package org.eclipse.wst.css.core.internal.contenttype;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+
+import org.eclipse.wst.sse.core.internal.encoding.CodedIO;
+
+/**
+ * This is an "adapter" class, simply to get in input stream to act like a
+ * reader. We could not use InputStreamReader directly because its internal
+ * buffers are not controllable, and it sometimes pulls too much out of input
+ * stream (even when it wasn't needed for our purposes).
+ *
+ * The use of this class is highly specialized and by not means meant to be
+ * general purpose. Its use is restricted to those cases where the input
+ * stream can be regarded as ascii just long enough to determine what the real
+ * encoding should be.
+ */
+
+public class ByteReader extends Reader {
+
+
+ public static final int DEFAULT_BUFFER_SIZE = CodedIO.MAX_BUF_SIZE;
+
+ protected byte[] fBuffer;
+
+ protected InputStream fInputStream;
+
+ protected ByteReader() {
+ super();
+ }
+
+ public ByteReader(InputStream inputStream) {
+ this(inputStream, DEFAULT_BUFFER_SIZE);
+ if (!inputStream.markSupported()) {
+ throw new IllegalArgumentException("ByteReader is required to have a resettable stream"); //$NON-NLS-1$
+ }
+ }
+
+ public ByteReader(InputStream inputStream, int size) {
+ this.fInputStream = inputStream;
+ if (!inputStream.markSupported()) {
+ throw new IllegalArgumentException("ByteReader is required to have a resettable stream"); //$NON-NLS-1$
+ }
+ this.fBuffer = new byte[size];
+
+ }
+
+ public void close() throws IOException {
+ this.fInputStream.close();
+ }
+
+ public void mark(int readAheadLimit) {
+ this.fInputStream.mark(readAheadLimit);
+ }
+
+ public boolean markSupported() {
+ return true;
+ }
+
+ public int read() throws IOException {
+ int b0 = this.fInputStream.read();
+ return (b0 & 0x00FF);
+ }
+
+ public int read(char ch[], int offset, int length) throws IOException {
+ if (length > this.fBuffer.length) {
+ length = this.fBuffer.length;
+ }
+
+ int count = this.fInputStream.read(this.fBuffer, 0, length);
+
+ for (int i = 0; i < count; i++) {
+ int b0 = this.fBuffer[i];
+ // the 0x00FF is to "lose" the negative bits filled in the byte to
+ // int conversion
+ // (and which would be there if cast directly from byte to char).
+ char c0 = (char) (b0 & 0x00FF);
+ ch[offset + i] = c0;
+ }
+ return count;
+ }
+
+ public boolean ready() throws IOException {
+ return this.fInputStream.available() > 0;
+ }
+
+ public void reset() throws IOException {
+ this.fInputStream.reset();
+ }
+
+ public long skip(long n) throws IOException {
+ return this.fInputStream.skip(n);
+ }
+
+}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSResourceEncodingDetector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSResourceEncodingDetector.java
index 1827a89..b6b6e68 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSResourceEncodingDetector.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSResourceEncodingDetector.java
@@ -25,7 +25,6 @@
import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
import org.eclipse.wst.sse.core.internal.encoding.IResourceCharsetDetector;
import org.eclipse.wst.sse.core.internal.encoding.NonContentBasedEncodingRules;
-import org.eclipse.wst.sse.core.internal.encoding.util.ByteReader;
import org.eclipse.wst.xml.core.internal.contenttype.EncodingParserConstants;
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/AbstractResourceEncodingDetector.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/AbstractResourceEncodingDetector.java
index e9c89af..07937e3 100644
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/AbstractResourceEncodingDetector.java
+++ b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/AbstractResourceEncodingDetector.java
@@ -26,7 +26,6 @@
import org.eclipse.wst.sse.core.internal.encoding.CodedIO;
import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
import org.eclipse.wst.sse.core.internal.encoding.IResourceCharsetDetector;
-import org.eclipse.wst.sse.core.internal.encoding.util.ByteReader;
public abstract class AbstractResourceEncodingDetector implements IResourceCharsetDetector {
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/ByteReader.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/ByteReader.java
new file mode 100644
index 0000000..1550a62
--- /dev/null
+++ b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/ByteReader.java
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Jens Lukowski/Innoopract - initial renaming/restructuring
+ *
+ *******************************************************************************/
+package org.eclipse.wst.dtd.core.internal.encoding;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+
+import org.eclipse.wst.sse.core.internal.encoding.CodedIO;
+
+/**
+ * This is an "adapter" class, simply to get in input stream to act like a
+ * reader. We could not use InputStreamReader directly because its internal
+ * buffers are not controllable, and it sometimes pulls too much out of input
+ * stream (even when it wasn't needed for our purposes).
+ *
+ * The use of this class is highly specialized and by not means meant to be
+ * general purpose. Its use is restricted to those cases where the input
+ * stream can be regarded as ascii just long enough to determine what the real
+ * encoding should be.
+ */
+
+public class ByteReader extends Reader {
+
+
+ public static final int DEFAULT_BUFFER_SIZE = CodedIO.MAX_BUF_SIZE;
+
+ protected byte[] fBuffer;
+
+ protected InputStream fInputStream;
+
+ protected ByteReader() {
+ super();
+ }
+
+ public ByteReader(InputStream inputStream) {
+ this(inputStream, DEFAULT_BUFFER_SIZE);
+ if (!inputStream.markSupported()) {
+ throw new IllegalArgumentException("ByteReader is required to have a resettable stream"); //$NON-NLS-1$
+ }
+ }
+
+ public ByteReader(InputStream inputStream, int size) {
+ this.fInputStream = inputStream;
+ if (!inputStream.markSupported()) {
+ throw new IllegalArgumentException("ByteReader is required to have a resettable stream"); //$NON-NLS-1$
+ }
+ this.fBuffer = new byte[size];
+
+ }
+
+ public void close() throws IOException {
+ this.fInputStream.close();
+ }
+
+ public void mark(int readAheadLimit) {
+ this.fInputStream.mark(readAheadLimit);
+ }
+
+ public boolean markSupported() {
+ return true;
+ }
+
+ public int read() throws IOException {
+ int b0 = this.fInputStream.read();
+ return (b0 & 0x00FF);
+ }
+
+ public int read(char ch[], int offset, int length) throws IOException {
+ if (length > this.fBuffer.length) {
+ length = this.fBuffer.length;
+ }
+
+ int count = this.fInputStream.read(this.fBuffer, 0, length);
+
+ for (int i = 0; i < count; i++) {
+ int b0 = this.fBuffer[i];
+ // the 0x00FF is to "lose" the negative bits filled in the byte to
+ // int conversion
+ // (and which would be there if cast directly from byte to char).
+ char c0 = (char) (b0 & 0x00FF);
+ ch[offset + i] = c0;
+ }
+ return count;
+ }
+
+ public boolean ready() throws IOException {
+ return this.fInputStream.available() > 0;
+ }
+
+ public void reset() throws IOException {
+ this.fInputStream.reset();
+ }
+
+ public long skip(long n) throws IOException {
+ return this.fInputStream.skip(n);
+ }
+
+}
diff --git a/bundles/org.eclipse.wst.html.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.html.core/META-INF/MANIFEST.MF
index f9c7939..2e3aff8 100644
--- a/bundles/org.eclipse.wst.html.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.html.core/META-INF/MANIFEST.MF
@@ -32,4 +32,4 @@
org.eclipse.wst.common.uriresolver,
org.eclipse.core.resources,
org.eclipse.core.runtime
-Eclipse-AutoStart: true
+Eclipse-AutoStart: true; exceptions="org.eclipse.wst.html.core.internal.contenttype"
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/AbstractResourceEncodingDetector.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/AbstractResourceEncodingDetector.java
index 0e62a88..66b6bc2 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/AbstractResourceEncodingDetector.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/AbstractResourceEncodingDetector.java
@@ -26,7 +26,6 @@
import org.eclipse.wst.sse.core.internal.encoding.CodedIO;
import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
import org.eclipse.wst.sse.core.internal.encoding.IResourceCharsetDetector;
-import org.eclipse.wst.sse.core.internal.encoding.util.ByteReader;
public abstract class AbstractResourceEncodingDetector implements IResourceCharsetDetector {
@@ -38,7 +37,7 @@
protected Reader fReader;
/**
- *
+ *
*/
public AbstractResourceEncodingDetector() {
super();
@@ -98,14 +97,16 @@
Charset javaCharset = null;
try {
javaCharset = Charset.forName(detectedCharsetName);
- } catch (UnsupportedCharsetException e) {
+ }
+ catch (UnsupportedCharsetException e) {
// only set invalid, if result is same as detected -- they won't
// be equal if
// overridden
if (result != null && result.equals(detectedCharsetName)) {
fEncodingMemento.setInvalidEncoding(detectedCharsetName);
}
- } catch (IllegalCharsetNameException e) {
+ }
+ catch (IllegalCharsetNameException e) {
// only set invalid, if result is same as detected -- they won't
// be equal if
// overridden
@@ -179,7 +180,7 @@
String encodingName;
encodingName = getSpecDefaultEncoding();
if (encodingName != null) {
- //createEncodingMemento(encodingName,
+ // createEncodingMemento(encodingName,
// EncodingMemento.USED_CONTENT_TYPE_DEFAULT);
fEncodingMemento = new EncodingMemento();
fEncodingMemento.setJavaCharsetName(encodingName);
@@ -197,7 +198,7 @@
abstract protected void parseInput() throws IOException;
/**
- *
+ *
*/
private void resetAll() {
fReader = null;
@@ -206,14 +207,15 @@
}
/**
- *
+ *
*/
public void set(InputStream inputStream) {
resetAll();
fReader = new ByteReader(inputStream);
try {
fReader.mark(CodedIO.MAX_MARK_SIZE);
- } catch (IOException e) {
+ }
+ catch (IOException e) {
// impossible, since we know ByteReader
// supports marking
throw new Error(e);
@@ -221,7 +223,7 @@
}
/**
- *
+ *
*/
public void set(IStorage iStorage) throws CoreException {
resetAll();
@@ -250,7 +252,8 @@
}
try {
fReader.mark(CodedIO.MAX_MARK_SIZE);
- } catch (IOException e) {
+ }
+ catch (IOException e) {
// impossble, since we just checked if markable
throw new Error(e);
}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/ByteReader.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/ByteReader.java
new file mode 100644
index 0000000..bfca51a
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/ByteReader.java
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Jens Lukowski/Innoopract - initial renaming/restructuring
+ *
+ *******************************************************************************/
+package org.eclipse.wst.html.core.internal.contenttype;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+
+import org.eclipse.wst.sse.core.internal.encoding.CodedIO;
+
+/**
+ * This is an "adapter" class, simply to get in input stream to act like a
+ * reader. We could not use InputStreamReader directly because its internal
+ * buffers are not controllable, and it sometimes pulls too much out of input
+ * stream (even when it wasn't needed for our purposes).
+ *
+ * The use of this class is highly specialized and by not means meant to be
+ * general purpose. Its use is restricted to those cases where the input
+ * stream can be regarded as ascii just long enough to determine what the real
+ * encoding should be.
+ */
+
+public class ByteReader extends Reader {
+
+
+ public static final int DEFAULT_BUFFER_SIZE = CodedIO.MAX_BUF_SIZE;
+
+ protected byte[] fBuffer;
+
+ protected InputStream fInputStream;
+
+ protected ByteReader() {
+ super();
+ }
+
+ public ByteReader(InputStream inputStream) {
+ this(inputStream, DEFAULT_BUFFER_SIZE);
+ if (!inputStream.markSupported()) {
+ throw new IllegalArgumentException("ByteReader is required to have a resettable stream"); //$NON-NLS-1$
+ }
+ }
+
+ public ByteReader(InputStream inputStream, int size) {
+ this.fInputStream = inputStream;
+ if (!inputStream.markSupported()) {
+ throw new IllegalArgumentException("ByteReader is required to have a resettable stream"); //$NON-NLS-1$
+ }
+ this.fBuffer = new byte[size];
+
+ }
+
+ public void close() throws IOException {
+ this.fInputStream.close();
+ }
+
+ public void mark(int readAheadLimit) {
+ this.fInputStream.mark(readAheadLimit);
+ }
+
+ public boolean markSupported() {
+ return true;
+ }
+
+ public int read() throws IOException {
+ int b0 = this.fInputStream.read();
+ return (b0 & 0x00FF);
+ }
+
+ public int read(char ch[], int offset, int length) throws IOException {
+ if (length > this.fBuffer.length) {
+ length = this.fBuffer.length;
+ }
+
+ int count = this.fInputStream.read(this.fBuffer, 0, length);
+
+ for (int i = 0; i < count; i++) {
+ int b0 = this.fBuffer[i];
+ // the 0x00FF is to "lose" the negative bits filled in the byte to
+ // int conversion
+ // (and which would be there if cast directly from byte to char).
+ char c0 = (char) (b0 & 0x00FF);
+ ch[offset + i] = c0;
+ }
+ return count;
+ }
+
+ public boolean ready() throws IOException {
+ return this.fInputStream.available() > 0;
+ }
+
+ public void reset() throws IOException {
+ this.fInputStream.reset();
+ }
+
+ public long skip(long n) throws IOException {
+ return this.fInputStream.skip(n);
+ }
+
+}
diff --git a/bundles/org.eclipse.wst.xml.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.xml.core/META-INF/MANIFEST.MF
index 001c968..5f6846d 100644
--- a/bundles/org.eclipse.wst.xml.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.xml.core/META-INF/MANIFEST.MF
@@ -59,4 +59,4 @@
org.eclipse.text,
org.eclipse.wst.common.uriresolver,
org.eclipse.wst.validation
-Eclipse-AutoStart: true
+Eclipse-AutoStart: true; exceptions="org.eclipse.wst.xml.core.internal.contenttype"
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/AbstractResourceEncodingDetector.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/AbstractResourceEncodingDetector.java
index 8d03de8..0fa5bc6 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/AbstractResourceEncodingDetector.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/AbstractResourceEncodingDetector.java
@@ -23,10 +23,10 @@
import org.eclipse.core.resources.IStorage;
import org.eclipse.core.runtime.CoreException;
+
import org.eclipse.wst.sse.core.internal.encoding.CodedIO;
import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
import org.eclipse.wst.sse.core.internal.encoding.IResourceCharsetDetector;
-import org.eclipse.wst.sse.core.internal.encoding.util.ByteReader;
public abstract class AbstractResourceEncodingDetector implements IResourceCharsetDetector {
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/ByteReader.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/ByteReader.java
index e5f04fa..d9ae470 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/ByteReader.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/ByteReader.java
@@ -16,6 +16,8 @@
import java.io.InputStream;
import java.io.Reader;
+import org.eclipse.wst.sse.core.internal.encoding.CodedIO;
+
/**
* This is an "adapter" class, simply to get in input stream to act like a
* reader. We could not use InputStreamReader directly because its internal
@@ -30,8 +32,7 @@
public class ByteReader extends Reader {
- /** Default byte buffer size (2048). */
- public static final int DEFAULT_BUFFER_SIZE = 2048;
+ public static final int DEFAULT_BUFFER_SIZE = CodedIO.MAX_BUF_SIZE;
protected byte[] fBuffer;
@@ -87,7 +88,7 @@
// int conversion
// (and which would be there if cast directly from byte to char).
char c0 = (char) (b0 & 0x00FF);
- ch[i] = c0;
+ ch[offset + i] = c0;
}
return count;
}