Examples of BitColumn


Examples of com.google.code.or.common.glossary.column.BitColumn

      throws DatabusException
  {
    if (s instanceof BitColumn)
    {
      // This is in  byte order
      BitColumn bc = (BitColumn) s;
      byte[] ba = bc.getValue();
      ByteBuffer b = ByteBuffer.wrap(ba);
      return b;
    }
    else if (s instanceof BlobColumn)
    {
      BlobColumn bc = (BlobColumn) s;
      byte[] ba = bc.getValue();
      return ByteBuffer.wrap(ba);
    }
    else if (s instanceof DateColumn)
    {
      DateColumn dc =  (DateColumn) s;
View Full Code Here

Examples of com.google.code.or.common.glossary.column.BitColumn

  throws IOException {
    //
    int unusedColumnCount = 0;
    final byte[] types = tme.getColumnTypes();
    final Metadata metadata = tme.getColumnMetadata();
    final BitColumn nullColumns = is.readBit(types.length, true);
    final List<Column> columns = new ArrayList<Column>(types.length);
    for(int i = 0; i < types.length; ++i) {
      //
      int length = 0;
      final int meta = metadata.getMetadata(i);
      int type = CodecUtils.toUnsigned(types[i]);
      if(type == MySQLConstants.TYPE_STRING && meta > 256) {
        final int meta0 = meta >> 8;
        final int meta1 = meta & 0xFF;
        if ((meta0 & 0x30) != 0x30) { // a long CHAR() field: see #37426
          type = meta0 | 0x30;
          length = meta1 | (((meta0 & 0x30) ^ 0x30) << 4);
        } else {
          switch (meta0) {
          case MySQLConstants.TYPE_SET:
          case MySQLConstants.TYPE_ENUM:
          case MySQLConstants.TYPE_STRING:
            type = meta0;
            length = meta1;
            break;
          default:
            throw new NestableRuntimeException("assertion failed, unknown column type: " + type);
          }
        }
      }
     
      //
      if(!usedColumns.get(i)) {
        unusedColumnCount++;
        continue;
      } else if(nullColumns.get(i - unusedColumnCount)) {
        columns.add(NullColumn.valueOf(type));
        continue;
      }
     
      //
View Full Code Here

Examples of com.google.code.or.common.glossary.column.BitColumn

  throws IOException {
    //
    int unusedColumnCount = 0;
    final byte[] types = tme.getColumnTypes();
    final Metadata metadata = tme.getColumnMetadata();
    final BitColumn nullColumns = is.readBit(types.length);
    final List<Column> columns = new ArrayList<Column>(types.length);
    for(int i = 0; i < types.length; ++i) {
      //
      int length = 0;
      final int meta = metadata.getMetadata(i);
      int type = CodecUtils.toUnsigned(types[i]);
      if(type == MySQLConstants.TYPE_STRING && meta > 256) {
        final int meta0 = meta >> 8;
        final int meta1 = meta & 0xFF;
        if ((meta0 & 0x30) != 0x30) { // a long CHAR() field: see #37426
          type = meta0 | 0x30;
          length = meta1 | (((meta0 & 0x30) ^ 0x30) << 4);
        } else {
          switch (meta0) {
          case MySQLConstants.TYPE_SET:
          case MySQLConstants.TYPE_ENUM:
          case MySQLConstants.TYPE_STRING:
            type = meta0;
            length = meta1;
            break;
          default:
            throw new RuntimeException("assertion failed, unknown column type: " + type);
          }
        }
      }
     
      //
      if(!usedColumns.get(i)) {
        unusedColumnCount++;
        continue;
      } else if(nullColumns.get(i - unusedColumnCount)) {
        columns.add(NullColumn.valueOf(type));
        continue;
      }
     
      //
View Full Code Here

Examples of com.google.code.or.common.glossary.column.BitColumn

  throws IOException {
    //
    int unusedColumnCount = 0;
    final byte[] types = tme.getColumnTypes();
    final Metadata metadata = tme.getColumnMetadata();
    final BitColumn nullColumns = is.readBit(types.length);
    final List<Column> columns = new ArrayList<Column>(types.length);
    for(int i = 0; i < types.length; ++i) {
      //
      int length = 0;
      final int meta = metadata.getMetadata(i);
      int type = CodecUtils.toUnsigned(types[i]);
      if(type == MySQLConstants.TYPE_STRING && meta > 256) {
        final int meta0 = meta >> 8;
        final int meta1 = meta & 0xFF;
        if ((meta0 & 0x30) != 0x30) { // a long CHAR() field: see #37426
          type = meta0 | 0x30;
          length = meta1 | (((meta0 & 0x30) ^ 0x30) << 4);
        } else {
          switch (meta0) {
          case MySQLConstants.TYPE_SET:
          case MySQLConstants.TYPE_ENUM:
          case MySQLConstants.TYPE_STRING:
            type = meta0;
            length = meta1;
            break;
          default:
            throw new RuntimeException("assertion failed, unknown column type: " + type);
          }
        }
      }
     
      //
      if(!usedColumns.get(i)) {
        unusedColumnCount++;
        continue;
      } else if(nullColumns.get(i - unusedColumnCount)) {
        columns.add(NullColumn.valueOf(type));
        continue;
      }
     
      //
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.