Loading obex/javax/obex/ApplicationParameter.java +18 −24 Original line number Diff line number Diff line Loading @@ -37,9 +37,11 @@ package javax.obex; */ public final class ApplicationParameter { private byte[] b_array; private int length; private int max_length = 1000; private byte[] mArray; private int mLength; private int mMaxLength = 1000; public static class TRIPLET_TAGID { public static final byte ORDER_TAGID = 0x01; Loading Loading @@ -91,7 +93,6 @@ public final class ApplicationParameter { public static class TRIPLET_LENGTH { public static final byte ORDER_LENGTH = 1; //public final byte SEARCH_VALUE_LENGTH = 0x02; public static final byte SEARCH_ATTRIBUTE_LENGTH = 1; public static final byte MAXLISTCOUNT_LENGTH = 2; Loading @@ -107,34 +108,27 @@ public final class ApplicationParameter { public static final byte NEWMISSEDCALLS_LENGTH = 1; } /* public class TRIPLET_STRUCTURE{ TRIPLET_TAGID id; TRIPLET_LENGTH length; byte[] value; } */ public ApplicationParameter() { b_array = new byte[max_length]; length = 0; mArray = new byte[mMaxLength]; mLength = 0; } public void addAPPHeader(byte tag, byte len, byte[] value) { if ((length + len + 2) > max_length) { byte[] array_tmp = new byte[length + 4 * len]; System.arraycopy(b_array, 0, array_tmp, 0, length); b_array = array_tmp; max_length = length + 4 * len; if ((mLength + len + 2) > mMaxLength) { byte[] array_tmp = new byte[mLength + 4 * len]; System.arraycopy(mArray, 0, array_tmp, 0, mLength); mArray = array_tmp; mMaxLength = mLength + 4 * len; } b_array[length++] = tag; b_array[length++] = len; System.arraycopy(value, 0, b_array, length, len); length += len; mArray[mLength++] = tag; mArray[mLength++] = len; System.arraycopy(value, 0, mArray, mLength, len); mLength += len; } public byte[] getAPPparam() { byte[] para = new byte[length]; System.arraycopy(b_array, 0, para, 0, length); byte[] para = new byte[mLength]; System.arraycopy(mArray, 0, para, 0, mLength); return para; } } obex/javax/obex/Authenticator.java +3 −3 Original line number Diff line number Diff line Loading @@ -106,8 +106,8 @@ public interface Authenticator { * @return a <code>PasswordAuthentication</code> object containing the * user name and password used for authentication */ public PasswordAuthentication onAuthenticationChallenge(String description, boolean isUserIdRequired, boolean isFullAccess); PasswordAuthentication onAuthenticationChallenge(String description, boolean isUserIdRequired, boolean isFullAccess); /** * Called when a client or server receives an authentication response Loading @@ -120,5 +120,5 @@ public interface Authenticator { * @return the correct password for the user name provided; if * <code>null</code> is returned then the authentication request failed */ public byte[] onAuthenticationResponse(byte[] userName); byte[] onAuthenticationResponse(byte[] userName); } obex/javax/obex/BaseStream.java +4 −4 Original line number Diff line number Diff line Loading @@ -47,7 +47,7 @@ public interface BaseStream { * * @throws IOException if the object is closed */ public void ensureOpen() throws IOException; void ensureOpen() throws IOException; /** * Verifies that additional information may be sent. In other words, the Loading @@ -55,7 +55,7 @@ public interface BaseStream { * * @throws IOException if the operation is completed */ public void ensureNotDone() throws IOException; void ensureNotDone() throws IOException; /** * Continues the operation since there is no data to read. Loading @@ -69,7 +69,7 @@ public interface BaseStream { * * @throws IOException if an IO error occurs */ public boolean continueOperation(boolean sendEmpty, boolean inStream) throws IOException; boolean continueOperation(boolean sendEmpty, boolean inStream) throws IOException; /** * Called when the output or input stream is closed. Loading @@ -79,5 +79,5 @@ public interface BaseStream { * * @throws IOException if an IO error occurs */ public void streamClosed(boolean inStream) throws IOException; void streamClosed(boolean inStream) throws IOException; } Loading
obex/javax/obex/ApplicationParameter.java +18 −24 Original line number Diff line number Diff line Loading @@ -37,9 +37,11 @@ package javax.obex; */ public final class ApplicationParameter { private byte[] b_array; private int length; private int max_length = 1000; private byte[] mArray; private int mLength; private int mMaxLength = 1000; public static class TRIPLET_TAGID { public static final byte ORDER_TAGID = 0x01; Loading Loading @@ -91,7 +93,6 @@ public final class ApplicationParameter { public static class TRIPLET_LENGTH { public static final byte ORDER_LENGTH = 1; //public final byte SEARCH_VALUE_LENGTH = 0x02; public static final byte SEARCH_ATTRIBUTE_LENGTH = 1; public static final byte MAXLISTCOUNT_LENGTH = 2; Loading @@ -107,34 +108,27 @@ public final class ApplicationParameter { public static final byte NEWMISSEDCALLS_LENGTH = 1; } /* public class TRIPLET_STRUCTURE{ TRIPLET_TAGID id; TRIPLET_LENGTH length; byte[] value; } */ public ApplicationParameter() { b_array = new byte[max_length]; length = 0; mArray = new byte[mMaxLength]; mLength = 0; } public void addAPPHeader(byte tag, byte len, byte[] value) { if ((length + len + 2) > max_length) { byte[] array_tmp = new byte[length + 4 * len]; System.arraycopy(b_array, 0, array_tmp, 0, length); b_array = array_tmp; max_length = length + 4 * len; if ((mLength + len + 2) > mMaxLength) { byte[] array_tmp = new byte[mLength + 4 * len]; System.arraycopy(mArray, 0, array_tmp, 0, mLength); mArray = array_tmp; mMaxLength = mLength + 4 * len; } b_array[length++] = tag; b_array[length++] = len; System.arraycopy(value, 0, b_array, length, len); length += len; mArray[mLength++] = tag; mArray[mLength++] = len; System.arraycopy(value, 0, mArray, mLength, len); mLength += len; } public byte[] getAPPparam() { byte[] para = new byte[length]; System.arraycopy(b_array, 0, para, 0, length); byte[] para = new byte[mLength]; System.arraycopy(mArray, 0, para, 0, mLength); return para; } }
obex/javax/obex/Authenticator.java +3 −3 Original line number Diff line number Diff line Loading @@ -106,8 +106,8 @@ public interface Authenticator { * @return a <code>PasswordAuthentication</code> object containing the * user name and password used for authentication */ public PasswordAuthentication onAuthenticationChallenge(String description, boolean isUserIdRequired, boolean isFullAccess); PasswordAuthentication onAuthenticationChallenge(String description, boolean isUserIdRequired, boolean isFullAccess); /** * Called when a client or server receives an authentication response Loading @@ -120,5 +120,5 @@ public interface Authenticator { * @return the correct password for the user name provided; if * <code>null</code> is returned then the authentication request failed */ public byte[] onAuthenticationResponse(byte[] userName); byte[] onAuthenticationResponse(byte[] userName); }
obex/javax/obex/BaseStream.java +4 −4 Original line number Diff line number Diff line Loading @@ -47,7 +47,7 @@ public interface BaseStream { * * @throws IOException if the object is closed */ public void ensureOpen() throws IOException; void ensureOpen() throws IOException; /** * Verifies that additional information may be sent. In other words, the Loading @@ -55,7 +55,7 @@ public interface BaseStream { * * @throws IOException if the operation is completed */ public void ensureNotDone() throws IOException; void ensureNotDone() throws IOException; /** * Continues the operation since there is no data to read. Loading @@ -69,7 +69,7 @@ public interface BaseStream { * * @throws IOException if an IO error occurs */ public boolean continueOperation(boolean sendEmpty, boolean inStream) throws IOException; boolean continueOperation(boolean sendEmpty, boolean inStream) throws IOException; /** * Called when the output or input stream is closed. Loading @@ -79,5 +79,5 @@ public interface BaseStream { * * @throws IOException if an IO error occurs */ public void streamClosed(boolean inStream) throws IOException; void streamClosed(boolean inStream) throws IOException; }