Write shifting operations.
Type is one of LEFT_SHIFT, RIGHT_SHIFT, or RIGHT_SHIFT_UNSIGNED

@param type the token type
@return true on a successful shift operation write
540636
protected boolean writeShiftOp(int type, boolean simulate) {
        type = type - LEFT_SHIFT;
        if (type < 0 || type > 2) return false;

        if (!simulate) {
            int bytecode = getShiftOperationBytecode(type);
            controller.getMethodVisitor().visitInsn(bytecode);
            controller.getOperandStack().replace(getNormalOpResultType(), 2);
        }
        return true;
    }
1295643
function(type){
    var i = 1
      , la;

    while (la = this.lookahead(i++)) {
      if (~['indent', 'outdent', 'newline', 'eos'].indexOf(la.type)) return;
      if (type == la.type) return true;
    }
  }
209348
@Override
  public void write(byte []buffer, int offset, int length,
                    boolean isEnd)
    throws IOException
  {
    int position = _position;
    
    if (length < 0) {
      throw new IllegalArgumentException();
    }
    
    if (_indexAddress < position + length) {
      throw new IllegalArgumentException(L.l("Segment write overflow pos=0x{0} len=0x{1} entry-head=0x{2} seg-len=0x{3}. {4}",
                                          Long.toHexString(_position),
                                          Long.toHexString(length),
                                          Long.toHexString(_indexAddress),
                                          Long.toHexString(_segment.length()),
                                          _segment));
    }
    

    //try (StoreWrite sOut = _readWrite.openWrite(_segment.getAddress(),
    //                                                _segment.getLength())) {
    
    _sOut.write(_segment.getAddress() + position, buffer, offset, length);

    _position = position + length;
      
    _isDirty = true;
  }
1293714
static boolean isAssociative(Token type) {
    switch (type) {
      case MUL:
      case AND:
      case OR:
      case BITOR:
      case BITXOR:
      case BITAND:
        return true;
      default:
        return false;
    }
  }
834235
protected void writeFieldType(Type type) {

        writeBytes(nextSep);

        switch (type.typeCode) {

            case Types.SQL_VARCHAR :
            case Types.VARCHAR_IGNORECASE :
                nextSep    = varSep;
                nextSepEnd = varSepEnd;
                break;

            default :
                nextSep    = fieldSep;
                nextSepEnd = fieldSepEnd;
                break;
        }
    }
1077565
public static <T> TypeToken<T> of(Type type) {
    Assert.notNull(type, "type");
    return new TypeToken<T>(type);
  }
348477
public void write(EnumType type) throws XMLStreamException {

        LOG.debug("Writing type {} of type {}", type.getName(), type.getMetaType());

        xmlWriter.writeStartElement(ENUM_TYPE);
        xmlWriter.writeAttribute(NAME, type.getName());
        for (EnumMember member : type.getMembers()) {
            xmlWriter.writeStartElement(ENUM_MEMBER);
            xmlWriter.writeAttribute(NAME, member.getName());
            xmlWriter.writeEndElement();
        }
        xmlWriter.writeEndElement();
    }
446643
public void writeMapBegin(String type)
        throws IOException
    {
        if (SIZE < _offset + 32)
            flushBuffer();

        if (type != null) {
            _buffer[_offset++] = BC_MAP;

            writeType(type);
        }
        else
            _buffer[_offset++] = BC_MAP_UNTYPED;
    }
506627
public boolean hasConversion(String type) {
		if ((isImplicitSarlTypes() && type.startsWith(IMPLICIT_PACKAGE))
			|| isImplicitJvmTypes()) {
			return true;
		}
		if (this.mapping == null) {
			this.mapping = initMapping();
		}
		return this.mapping.containsKey(type);
	}
364464
private void writeTypedBytes(final int type, final byte[] data, final int offset, final int length)
    {
        int totalLength = 1 + length;
        if (length < 14)
        {
            buffer.writeUInt8(type | length);
        }
        else
        {
            // need to specify length explicitly
            buffer.writeUInt8(type | 0xE);
            final int sizeLength = buffer.writeVarUInt(length);
            totalLength += sizeLength;
        }
        updateLength(totalLength);
        buffer.writeBytes(data, offset, length);
    }
1237160
public static void writeNativeValue(Type type, BlockBuilder blockBuilder, Object value)
    {
        if (value == null) {
            blockBuilder.appendNull();
        }
        else if (type.getJavaType() == boolean.class) {
            type.writeBoolean(blockBuilder, (Boolean) value);
        }
        else if (type.getJavaType() == double.class) {
            type.writeDouble(blockBuilder, ((Number) value).doubleValue());
        }
        else if (type.getJavaType() == long.class) {
            type.writeLong(blockBuilder, ((Number) value).longValue());
        }
        else if (type.getJavaType() == Slice.class) {
            Slice slice;
            if (value instanceof byte[]) {
                slice = Slices.wrappedBuffer((byte[]) value);
            }
            else if (value instanceof String) {
                slice = Slices.utf8Slice((String) value);
            }
            else {
                slice = (Slice) value;
            }
            type.writeSlice(blockBuilder, slice, 0, slice.length());
        }
1302519
@Override
    public synchronized void write(byte[] b, int off, int len) throws IOException {
        super.write(b, off, len);
        this.branch.write(b, off, len);
    }
100093
private void writeSimple(Class<?> declaredType, Object value) throws IOException {
        // simple types have no need to write a type object
        Class<?> realType = value.getClass();
        if (realType == Integer.class) {
            output.writeInt(((Integer) value).intValue());
            return;
        } else if (realType == Double.class) {
            double dbl = ((Double) value).doubleValue();
            if (Double.isNaN(dbl) == false && Double.isInfinite(dbl) == false) {
                output.writeDouble(dbl);
                return;
            }
        } else if (realType == Boolean.class) {
            output.writeBoolean(((Boolean) value).booleanValue());
            return;
        }
        
        // handle no declared type and subclasses
        Class<?> effectiveType = declaredType;
        boolean requiresClose = false;
        if (declaredType == Object.class) {
            if (realType != String.class) {
                effectiveType = settings.getConverter().findTypedConverter(realType).getEffectiveType();
                String typeStr = SerTypeMapper.encodeType(effectiveType, settings, basePackage, knownTypes);
                output.writeObjectStart();
                output.writeObjectKeyValue(TYPE, typeStr);
                output.writeObjectKey(VALUE);
                requiresClose = true;
            } else {
                effectiveType = realType;
            }
        } else if (settings.getConverter().isConvertible(declaredType) == false) {
            effectiveType = settings.getConverter().findTypedConverter(realType).getEffectiveType();
            String typeStr = SerTypeMapper.encodeType(effectiveType, settings, basePackage, knownTypes);
            output.writeObjectStart();
            output.writeObjectKeyValue(TYPE, typeStr);
            output.writeObjectKey(VALUE);
            requiresClose = true;
        }
        
        // long/short/byte/float only processed now to ensure that exact numeric type can be identified
        if (realType == Long.class) {
            output.writeLong(((Long) value).longValue());
            
        } else if (realType == Short.class) {
            output.writeInt(((Short) value).shortValue());
            
        } else if (realType == Byte.class) {
            output.writeInt(((Byte) value).byteValue());
            
        } else if (realType == Float.class) {
            output.writeFloat(((Float) value).floatValue());
            
        } else {
            // write as a string
            try {
                String converted = settings.getConverter().convertToString(effectiveType, value);
                if (converted == null) {
                    throw new IllegalArgumentException("Unable to write because converter returned a null string: " + value);
                }
                output.writeString(converted);
            } catch (RuntimeException ex) {
                throw new IllegalArgumentException(
                        "Unable to convert type " + effectiveType.getName() + " declared as " + declaredType.getName(), ex);
            }
        }
        
        // close open map
        if (requiresClose) {
            output.writeObjectEnd();
        }
    }
452765
protected static boolean writeXMLType(Output out, Object xml) {
        log.trace("writeXMLType");
        // If it's a Document write it as Document
        if (xml instanceof Document) {
            writeDocument(out, (Document) xml);
        } else {
            return false;
        }
        return true;
    }
3342
public boolean checkWrite()
    {
        if (!outActive || state != State.ACTIVE) {
            return false;
        }

        // TODO DIFF V4 small change, it is done like this in 4.2.2
        boolean full = !checkHwm();

        if (full) {
            outActive = false;
            return false;
        }

        return true;
    }
1117216
public static boolean isBasicType(String type){
		for(String basicType : basicTypeArray){
			if(basicType.equals(type)){
				return true;
			}
		}
		return false;
	}
277336
public void write(byte[] b, int off, int len)
        throws IOException
    {
        if (_encoding==null)
            _writer.write(new String(b,off,len));
        else
            _writer.write(new String(b,off,len,_encoding));
    }