本文整理汇总了Java中org.hsqldb.types.BinaryData类的典型用法代码示例。如果您正苦于以下问题:Java BinaryData类的具体用法?Java BinaryData怎么用?Java BinaryData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BinaryData类属于org.hsqldb.types包,在下文中一共展示了BinaryData类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: scanBinaryString
import org.hsqldb.types.BinaryData; //导入依赖的package包/类
void scanBinaryString() {
byteOutputStream.reset(byteBuffer);
while (true) {
scanBinaryStringPart();
if (token.isMalformed) {
return;
}
if (scanSeparator() && charAt(currentPosition) == '\'') {
continue;
}
break;
}
token.tokenValue = new BinaryData(byteOutputStream.toByteArray(),
false);
byteOutputStream.reset(byteBuffer);
}
开发者ID:Julien35,项目名称:dev-courses,代码行数:24,代码来源:Scanner.java
示例2: getBinaryStream
import org.hsqldb.types.BinaryData; //导入依赖的package包/类
/**
* <!-- start generic documentation -->
* Retrieves the value of the designated column in the current row
* of this <code>ResultSet</code> object as a stream of
* uninterpreted bytes. The value can then be read in chunks from the
* stream. This method is particularly
* suitable for retrieving large <code>LONGVARBINARY</code> values.
*
* <P><B>Note:</B> All the data in the returned stream must be
* read prior to getting the value of any other column. The next
* call to a getter method implicitly closes the stream. Also, a
* stream may return <code>0</code> when the method
* <code>InputStream.available</code>
* is called whether there is data available or not.
* <!-- end generic documentation -->
*
* @param columnIndex the first column is 1, the second is 2, ...
* @return a Java input stream that delivers the database column value
* as a stream of uninterpreted bytes;
* if the value is SQL <code>NULL</code>, the value returned is
* <code>null</code>
* @exception SQLException if a database access error occurs or this method is
* called on a closed result set
*/
public java.io.InputStream getBinaryStream(
int columnIndex) throws SQLException {
checkColumn(columnIndex);
Type sourceType = resultMetaData.columnTypes[columnIndex - 1];
Object o = getColumnInType(columnIndex, sourceType);
if (o == null) {
return null;
}
if (o instanceof BlobDataID) {
return ((BlobDataID) o).getBinaryStream(session);
} else if (o instanceof Blob) {
return ((Blob) o).getBinaryStream();
} else if (o instanceof BinaryData) {
byte[] b = getBytes(columnIndex);
return new ByteArrayInputStream(b);
}
throw JDBCUtil.sqlException(ErrorCode.X_42561);
}
开发者ID:Julien35,项目名称:dev-courses,代码行数:49,代码来源:JDBCResultSet.java
示例3: scanBitString
import org.hsqldb.types.BinaryData; //导入依赖的package包/类
void scanBitString() {
BitMap map = new BitMap(32);
while (true) {
scanBitStringPart(map);
if (token.isMalformed) {
return;
}
if (scanSeparator() && charAt(currentPosition) == '\'') {
continue;
}
break;
}
token.tokenValue = new BinaryData(map.getBytes(), map.size());
}
开发者ID:s-store,项目名称:sstore-soft,代码行数:21,代码来源:Scanner.java
示例4: scanBitString
import org.hsqldb.types.BinaryData; //导入依赖的package包/类
void scanBitString() {
BitMap map = new BitMap(32, true);
while (true) {
scanBitStringPart(map);
if (token.isMalformed) {
return;
}
if (scanSeparator() && charAt(currentPosition) == '\'') {
continue;
}
break;
}
token.tokenValue = BinaryData.getBitData(map.getBytes(), map.size());
}
开发者ID:Julien35,项目名称:dev-courses,代码行数:21,代码来源:Scanner.java
示例5: readSizedBinaryData
import org.hsqldb.types.BinaryData; //导入依赖的package包/类
BinaryData readSizedBinaryData() throws IOException {
int len = readInt();
try {
return (len < 0) ? null : new BinaryData((long) len, this);
} catch (HsqlException he) {
throw new IOException(he.getMessage());
}
}
开发者ID:Julien35,项目名称:dev-courses,代码行数:9,代码来源:OdbcPacketInputStream.java
示例6: getBlob
import org.hsqldb.types.BinaryData; //导入依赖的package包/类
/**
* <!-- start generic documentation -->
* Retrieves the value of the designated column in the current row
* of this <code>ResultSet</code> object as a <code>Blob</code> object
* in the Java programming language.
* <!-- end generic documentation -->
*
* <!-- start release-specific documentation -->
* <div class="ReleaseSpecificDocumentation">
* <h3>HSQLDB-Specific Information:</h3> <p>
*
* HSQLDB 2.0 supports this feature for objects of type BLOB and BINARY.
* The Blob returned for BINARY objects is a memory object. The Blob
* return for BLOB objects is not held entirely in memory. Its contents are
* fetched from the database when its getXXX() methods are called. <p>
* </div>
* <!-- end release-specific documentation -->
*
* @param columnIndex the first column is 1, the second is 2, ...
* @return a <code>Blob</code> object representing the SQL
* <code>BLOB</code> value in the specified column
* @exception SQLException if a database access error occurs
* or this method is called on a closed result set
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support
* this method
* @since JDK 1.2
*/
public Blob getBlob(int columnIndex) throws SQLException {
checkColumn(columnIndex);
Type sourceType = resultMetaData.columnTypes[columnIndex - 1];
Object o = getColumnInType(columnIndex, sourceType);
if (o == null) {
return null;
}
if (o instanceof BlobDataID) {
JDBCBlobClient blob = new JDBCBlobClient(session, (BlobDataID) o);
if (isUpdatable) {
if (resultMetaData.colIndexes[columnIndex - 1] > 0
&& resultMetaData.columns[columnIndex - 1]
.isWriteable()) {
blob.setWritable(this, columnIndex - 1);
}
}
return blob;
} else if (o instanceof Blob) {
return (Blob) o;
} else if (o instanceof BinaryData) {
byte[] b = getBytes(columnIndex);
return new JDBCBlob(b);
}
throw JDBCUtil.sqlException(ErrorCode.X_42561);
}
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:61,代码来源:JDBCResultSet.java
示例7: getCustomResult
import org.hsqldb.types.BinaryData; //导入依赖的package包/类
public static ResultSet getCustomResult(Connection connection, long start,
long end) throws SQLException {
Result result = newTwoColumnResult();
if (end < start) {
long temp = start;
start = end;
end = temp;
}
if (end > 1000) {
throw org.hsqldb.jdbc.JDBCUtil.invalidArgument(
"value larger than 100");
}
if (end > start + 100) {
end = start + 100;
}
for (long i = start; i < end; i++) {
Object[] row = new Object[2];
row[0] = Long.valueOf(i);
row[1] = new BinaryData(BigInteger.valueOf(i).toByteArray(),
false);
result.navigator.add(row);
}
result.navigator.reset();
return new JDBCResultSet((JDBCConnection) connection, null, result,
result.metaData);
}
开发者ID:Julien35,项目名称:dev-courses,代码行数:37,代码来源:TestJavaFunctions.java
示例8: readSizedBinaryData
import org.hsqldb.types.BinaryData; //导入依赖的package包/类
BinaryData readSizedBinaryData() throws IOException {
int len = readInt();
try {
return (len < 0) ? null
: new BinaryData((long) len, this);
} catch (HsqlException he) {
throw new IOException(he.getMessage());
}
}
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:12,代码来源:OdbcPacketInputStream.java
示例9: convertToBit
import org.hsqldb.types.BinaryData; //导入依赖的package包/类
public synchronized BinaryData convertToBit(String s) {
BitMap map = new BitMap(0, true);
int bitIndex = 0;
reset(s);
resetState();
byteOutputStream.reset(byteBuffer);
for (; currentPosition < limit; currentPosition++) {
int c = sqlString.charAt(currentPosition);
if (c == '0') {
map.unset(bitIndex);
bitIndex++;
} else if (c == '1') {
map.set(bitIndex);
bitIndex++;
} else {
token.tokenType = Tokens.X_MALFORMED_BIT_STRING;
token.isMalformed = true;
throw Error.error(ErrorCode.X_22018);
}
}
map.setSize(bitIndex);
return BinaryData.getBitData(map.getBytes(), map.size());
}
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:33,代码来源:Scanner.java
示例10: writeBit
import org.hsqldb.types.BinaryData; //导入依赖的package包/类
protected void writeBit(BinaryData o) {
ensureRoom((int) (o.length(null) * 8 + 2));
write('\'');
String s = StringConverter.byteArrayToBitString(o.getBytes(),
(int) o.bitLength(null));
writeBytes(s);
write('\'');
}
开发者ID:s-store,项目名称:sstore-soft,代码行数:12,代码来源:RowOutputTextLog.java
示例11: convertToBit
import org.hsqldb.types.BinaryData; //导入依赖的package包/类
public synchronized BinaryData convertToBit(String s) {
BitMap map = new BitMap(32, true);
int bitIndex = 0;
reset(s);
resetState();
byteOutputStream.reset(byteBuffer);
for (; currentPosition < limit; currentPosition++) {
int c = sqlString.charAt(currentPosition);
if (c == '0') {
map.unset(bitIndex);
bitIndex++;
} else if (c == '1') {
map.set(bitIndex);
bitIndex++;
} else {
token.tokenType = Tokens.X_MALFORMED_BIT_STRING;
token.isMalformed = true;
throw Error.error(ErrorCode.X_22018);
}
}
map.setSize(bitIndex);
return BinaryData.getBitData(map.getBytes(), map.size());
}
开发者ID:Julien35,项目名称:dev-courses,代码行数:33,代码来源:Scanner.java
示例12: getChar
import org.hsqldb.types.BinaryData; //导入依赖的package包/类
char getChar(Object o, int i) {
char c;
if (isBinary) {
c = (char) ((BinaryData) o).getBytes()[i];
} else {
c = ((String) o).charAt(i);
}
return c;
}
开发者ID:s-store,项目名称:sstore-soft,代码行数:13,代码来源:Like.java
示例13: getLength
import org.hsqldb.types.BinaryData; //导入依赖的package包/类
int getLength(SessionInterface session, Object o, String s) {
int l;
if (isBinary) {
l = (int) ((BinaryData) o).length(session);
} else {
l = ((String) o).length();
}
return l;
}
开发者ID:s-store,项目名称:sstore-soft,代码行数:13,代码来源:Like.java
示例14: getRangeHigh
import org.hsqldb.types.BinaryData; //导入依赖的package包/类
Object getRangeHigh(Session session) {
Object o = getStartsWith();
if (o == null) {
return null;
}
if (isBinary) {
return new BinaryData(session, (BinaryData) o, maxByteValue);
} else {
return dataType.concat(session, o, "\uffff");
}
}
开发者ID:s-store,项目名称:sstore-soft,代码行数:15,代码来源:Like.java
示例15: convertToBit
import org.hsqldb.types.BinaryData; //导入依赖的package包/类
public synchronized BinaryData convertToBit(String s) {
BitMap map = new BitMap(32);
int bitIndex = map.size();
reset(s);
resetState();
byteOutputStream.reset(byteBuffer);
for (; currentPosition < limit; currentPosition++) {
int c = sqlString.charAt(currentPosition);
if (c == '0') {
bitIndex++;
} else if (c == '1') {
map.set(bitIndex);
bitIndex++;
} else {
token.tokenType = Tokens.X_MALFORMED_BIT_STRING;
token.isMalformed = true;
throw Error.error(ErrorCode.X_22018);
}
}
map.setSize(bitIndex);
return new BinaryData(map.getBytes(), map.size());
}
开发者ID:s-store,项目名称:sstore-soft,代码行数:31,代码来源:Scanner.java
示例16: readOther
import org.hsqldb.types.BinaryData; //导入依赖的package包/类
protected Object readOther() {
String s = readString();
if (s == null) {
return null;
}
BinaryData data = scanner.convertToBinary(s);
if (data.length(null) == 0) {
return null;
}
return new JavaObjectData(data.getBytes());
}
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:17,代码来源:RowInputText.java
示例17: writeBit
import org.hsqldb.types.BinaryData; //导入依赖的package包/类
protected void writeBit(BinaryData o) {
writeInt((int) o.bitLength(null));
write(o.getBytes(), 0, o.getBytes().length);
}
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:5,代码来源:RowOutputBinary.java
示例18: writeBinary
import org.hsqldb.types.BinaryData; //导入依赖的package包/类
protected void writeBinary(BinaryData o) {
writeByteArray(o.getBytes());
}
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:4,代码来源:RowOutputBinary.java
示例19: readOther
import org.hsqldb.types.BinaryData; //导入依赖的package包/类
protected Object readOther() {
readFieldPrefix();
if (scanner.scanNull()) {
return null;
}
scanner.scanBinaryStringWithQuote();
if (scanner.getTokenType() == Tokens.X_MALFORMED_BINARY_STRING) {
throw Error.error(ErrorCode.X_42587);
}
value = scanner.getValue();
return new JavaObjectData(((BinaryData) value).getBytes());
}
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:19,代码来源:RowInputTextLog.java
示例20: readBit
import org.hsqldb.types.BinaryData; //导入依赖的package包/类
protected BinaryData readBit() {
readFieldPrefix();
if (scanner.scanNull()) {
return null;
}
scanner.scanBitStringWithQuote();
if (scanner.getTokenType() == Tokens.X_MALFORMED_BIT_STRING) {
throw Error.error(ErrorCode.X_42587);
}
value = scanner.getValue();
return (BinaryData) value;
}
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:19,代码来源:RowInputTextLog.java
注:本文中的org.hsqldb.types.BinaryData类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论