当前位置: 首页>>代码示例>>Java>>正文


Java LittleEndian.putUShort方法代码示例

本文整理汇总了Java中org.apache.poi.util.LittleEndian.putUShort方法的典型用法代码示例。如果您正苦于以下问题:Java LittleEndian.putUShort方法的具体用法?Java LittleEndian.putUShort怎么用?Java LittleEndian.putUShort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.poi.util.LittleEndian的用法示例。


在下文中一共展示了LittleEndian.putUShort方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: write

import org.apache.poi.util.LittleEndian; //导入方法依赖的package包/类
/**
 * Write this picture into <code>OutputStream</code>
 */
public void write(OutputStream out) throws IOException {
    byte[] data;

    data = new byte[LittleEndian.SHORT_SIZE];
    LittleEndian.putUShort(data, 0, getSignature());
    out.write(data);

    data = new byte[LittleEndian.SHORT_SIZE];
    LittleEndian.putUShort(data, 0, getType() + 0xF018);
    out.write(data);

    byte[] rawdata = getRawData();

    data = new byte[LittleEndian.INT_SIZE];
    LittleEndian.putInt(data, 0, rawdata.length);
    out.write(data);

    out.write(rawdata);
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:23,代码来源:PictureData.java

示例2: write

import org.apache.poi.util.LittleEndian; //导入方法依赖的package包/类
public void write(OutputStream out) throws IOException {
    byte[] header = new byte[22];
    int pos = 0;
    LittleEndian.putInt(header, pos, APMHEADER_KEY); pos += LittleEndian.INT_SIZE; //header key
    LittleEndian.putUShort(header, pos, 0); pos += LittleEndian.SHORT_SIZE; //hmf
    LittleEndian.putUShort(header, pos, left); pos += LittleEndian.SHORT_SIZE; //left
    LittleEndian.putUShort(header, pos, top); pos += LittleEndian.SHORT_SIZE; //top
    LittleEndian.putUShort(header, pos, right); pos += LittleEndian.SHORT_SIZE; //right
    LittleEndian.putUShort(header, pos, bottom); pos += LittleEndian.SHORT_SIZE; //bottom
    LittleEndian.putUShort(header, pos, inch); pos += LittleEndian.SHORT_SIZE; //inch
    LittleEndian.putInt(header, pos, 0); pos += LittleEndian.INT_SIZE;  //reserved

    checksum = getChecksum();
    LittleEndian.putUShort(header, pos, checksum);

    out.write(header);
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:18,代码来源:WMF.java

示例3: setAnchor

import org.apache.poi.util.LittleEndian; //导入方法依赖的package包/类
/**
 * Sets the anchor (the bounding box rectangle) of this shape.
 * All coordinates should be expressed in Master units (576 dpi).
 *
 * @param anchor new anchor
 */
public void setAnchor(java.awt.Rectangle anchor){

    EscherContainerRecord spContainer = (EscherContainerRecord)_escherContainer.getChild(0);

    EscherClientAnchorRecord clientAnchor = (EscherClientAnchorRecord)getEscherChild(spContainer, EscherClientAnchorRecord.RECORD_ID);
    //hack. internal variable EscherClientAnchorRecord.shortRecord can be
    //initialized only in fillFields(). We need to set shortRecord=false;
    byte[] header = new byte[16];
    LittleEndian.putUShort(header, 0, 0);
    LittleEndian.putUShort(header, 2, 0);
    LittleEndian.putInt(header, 4, 8);
    clientAnchor.fillFields(header, 0, null);

    clientAnchor.setFlag((short)(anchor.y*MASTER_DPI/POINT_DPI));
    clientAnchor.setCol1((short)(anchor.x*MASTER_DPI/POINT_DPI));
    clientAnchor.setDx1((short)((anchor.width + anchor.x)*MASTER_DPI/POINT_DPI));
    clientAnchor.setRow1((short)((anchor.height + anchor.y)*MASTER_DPI/POINT_DPI));

    EscherSpgrRecord spgr = (EscherSpgrRecord)getEscherChild(spContainer, EscherSpgrRecord.RECORD_ID);

    spgr.setRectX1(anchor.x*MASTER_DPI/POINT_DPI);
    spgr.setRectY1(anchor.y*MASTER_DPI/POINT_DPI);
    spgr.setRectX2((anchor.x + anchor.width)*MASTER_DPI/POINT_DPI);
    spgr.setRectY2((anchor.y + anchor.height)*MASTER_DPI/POINT_DPI);
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:32,代码来源:ShapeGroup.java

示例4: ColorSchemeAtom

import org.apache.poi.util.LittleEndian; //导入方法依赖的package包/类
/**
 * Create a new ColorSchemeAtom, to go with a new Slide
 */
public ColorSchemeAtom(){
	_header = new byte[8];
	LittleEndian.putUShort(_header, 0, 16);
	LittleEndian.putUShort(_header, 2, (int)_type);
	LittleEndian.putInt(_header, 4, 32);

	// Setup the default rgb values
	backgroundColourRGB = 16777215;
	textAndLinesColourRGB = 0;
	shadowsColourRGB = 8421504;
	titleTextColourRGB = 0;
	fillsColourRGB = 10079232;
	accentColourRGB = 13382451;
	accentAndHyperlinkColourRGB = 16764108;
	accentAndFollowingHyperlinkColourRGB = 11711154;
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:20,代码来源:ColorSchemeAtom.java

示例5: serialize

import org.apache.poi.util.LittleEndian; //导入方法依赖的package包/类
public void serialize( byte[] data, int offset )
{
    LittleEndian.putUShort( data, 0x0 + offset, field_1_wIdent );
    LittleEndian.putUShort( data, 0x2 + offset, field_2_nFib );
    LittleEndian.putUShort( data, 0x4 + offset, field_3_unused );
    LittleEndian.putUShort( data, 0x6 + offset, field_4_lid );
    LittleEndian.putUShort( data, 0x8 + offset, field_5_pnNext );
    LittleEndian.putShort( data, 0xa + offset, field_6_flags1 );
    LittleEndian.putUShort( data, 0xc + offset, field_7_nFibBack );
    LittleEndian.putInt( data, 0xe + offset, field_8_lKey );
    data[ 0x12 + offset ] = field_9_envr;
    data[ 0x13 + offset ] = field_10_flags2;
    LittleEndian.putShort( data, 0x14 + offset, field_11_Chs );
    LittleEndian.putShort( data, 0x16 + offset, field_12_chsTables );
    LittleEndian.putInt( data, 0x18 + offset, field_13_fcMin );
    LittleEndian.putInt( data, 0x1c + offset, field_14_fcMac );
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:18,代码来源:FibBaseAbstractType.java

示例6: Slide

import org.apache.poi.util.LittleEndian; //导入方法依赖的package包/类
/**
 * Create a new, empty, Slide, along with its required
 *  child records.
 */
public Slide(){
	_header = new byte[8];
	LittleEndian.putUShort(_header, 0, 15);
	LittleEndian.putUShort(_header, 2, (int)_type);
	LittleEndian.putInt(_header, 4, 0);

	slideAtom = new SlideAtom();
	ppDrawing = new PPDrawing();

	ColorSchemeAtom colorAtom = new ColorSchemeAtom();

	_children = new Record[] {
		slideAtom,
		ppDrawing,
		colorAtom
	};
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:22,代码来源:Slide.java

示例7: createSpContainer

import org.apache.poi.util.LittleEndian; //导入方法依赖的package包/类
/**
 * Create a new Shape
 *
 * @param isChild   <code>true</code> if the Line is inside a group, <code>false</code> otherwise
 * @return the record container which holds this shape
 */
protected EscherContainerRecord createSpContainer(boolean isChild) {
    _escherContainer = new EscherContainerRecord();
    _escherContainer.setRecordId( EscherContainerRecord.SP_CONTAINER );
    _escherContainer.setOptions((short)15);

    EscherSpRecord sp = new EscherSpRecord();
    int flags = EscherSpRecord.FLAG_HAVEANCHOR | EscherSpRecord.FLAG_HASSHAPETYPE;
    if (isChild) flags |= EscherSpRecord.FLAG_CHILD;
    sp.setFlags(flags);
    _escherContainer.addChildRecord(sp);

    EscherOptRecord opt = new EscherOptRecord();
    opt.setRecordId(EscherOptRecord.RECORD_ID);
    _escherContainer.addChildRecord(opt);

    EscherRecord anchor;
    if(isChild) anchor = new EscherChildAnchorRecord();
    else {
        anchor = new EscherClientAnchorRecord();

        //hack. internal variable EscherClientAnchorRecord.shortRecord can be
        //initialized only in fillFields(). We need to set shortRecord=false;
        byte[] header = new byte[16];
        LittleEndian.putUShort(header, 0, 0);
        LittleEndian.putUShort(header, 2, 0);
        LittleEndian.putInt(header, 4, 8);
        anchor.fillFields(header, 0, null);
    }
    _escherContainer.addChildRecord(anchor);

    return _escherContainer;
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:39,代码来源:SimpleShape.java

示例8: OutlineTextRefAtom

import org.apache.poi.util.LittleEndian; //导入方法依赖的package包/类
/**
 * Create a new instance of <code>FontEntityAtom</code>
 */
protected OutlineTextRefAtom() {
    _index = 0;

    _header = new byte[8];
    LittleEndian.putUShort(_header, 0, 0);
    LittleEndian.putUShort(_header, 2, (int)getRecordType());
    LittleEndian.putInt(_header, 4, 4);
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:12,代码来源:OutlineTextRefAtom.java

示例9: SlidePersistAtom

import org.apache.poi.util.LittleEndian; //导入方法依赖的package包/类
/**
 * Create a new SlidePersistAtom, for use with a new Slide
 */
public SlidePersistAtom(){
	_header = new byte[8];
	LittleEndian.putUShort(_header, 0, 0);
	LittleEndian.putUShort(_header, 2, (int)_type);
	LittleEndian.putInt(_header, 4, 20);

	hasShapesOtherThanPlaceholders = true;
	reservedFields = new byte[4];
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:13,代码来源:SlidePersistAtom.java

示例10: serialize

import org.apache.poi.util.LittleEndian; //导入方法依赖的package包/类
public void serialize( byte[] data, int offset )
{
    LittleEndian.putUShort(data, 0x0 + offset, field_1_cstd);
    LittleEndian.putUShort(data, 0x2 + offset, field_2_cbSTDBaseInFile);
    LittleEndian.putUShort(data, 0x4 + offset, field_3_info3);
    LittleEndian.putUShort(data, 0x6 + offset, field_4_stiMaxWhenSaved);
    LittleEndian.putUShort(data, 0x8 + offset, field_5_istdMaxFixedWhenSaved);
    LittleEndian.putUShort(data, 0xa + offset, field_6_nVerBuiltInNamesWhenSaved);
    LittleEndian.putShort(data, 0xc + offset, field_7_ftcAsci);
    LittleEndian.putShort(data, 0xe + offset, field_8_ftcFE);
    LittleEndian.putShort(data, 0x10 + offset, field_9_ftcOther);
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:13,代码来源:StshifAbstractType.java

示例11: serialize

import org.apache.poi.util.LittleEndian; //导入方法依赖的package包/类
public void serialize( byte[] data, int offset )
{
    LittleEndian.putShort(data, 0x0 + offset, field_1_info1);
    LittleEndian.putShort(data, 0x2 + offset, field_2_info2);
    LittleEndian.putShort(data, 0x4 + offset, field_3_info3);
    LittleEndian.putUShort(data, 0x6 + offset, field_4_bchUpe);
    LittleEndian.putShort(data, 0x8 + offset, field_5_grfstd);
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:9,代码来源:StdfBaseAbstractType.java

示例12: serialize

import org.apache.poi.util.LittleEndian; //导入方法依赖的package包/类
public int serialize( byte[] data, int startOffset )
{
    int offset = startOffset;

    _xst.serialize( data, offset );
    offset += _xst.getSize();

    LittleEndian.putUShort( data, offset, _chTerm );
    offset += LittleEndian.SHORT_SIZE;

    return offset - startOffset;
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:13,代码来源:Xstz.java

示例13: serialize

import org.apache.poi.util.LittleEndian; //导入方法依赖的package包/类
public byte[] serialize()
{
    byte[] buffer = new byte[getSize()];
    int offset = 0;

    _base.serialize( buffer, offset );
    offset += FFDataBase.getSize();

    offset += _xstzName.serialize( buffer, offset );

    if ( _base.getIType() == FFDataBase.ITYPE_TEXT )
    {
        offset += _xstzTextDef.serialize( buffer, offset );
    }

    if ( _base.getIType() == FFDataBase.ITYPE_CHCK
            || _base.getIType() == FFDataBase.ITYPE_DROP )
    {
        LittleEndian.putUShort( buffer, offset, _wDef );
        offset += LittleEndian.SHORT_SIZE;
    }

    offset += _xstzTextFormat.serialize( buffer, offset );
    offset += _xstzHelpText.serialize( buffer, offset );
    offset += _xstzStatText.serialize( buffer, offset );
    offset += _xstzEntryMcr.serialize( buffer, offset );
    offset += _xstzExitMcr.serialize( buffer, offset );

    if ( _base.getIType() == FFDataBase.ITYPE_DROP )
    {
        offset += _hsttbDropList.serialize( buffer, offset );
    }

    return buffer;
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:36,代码来源:FFData.java

示例14: OEPlaceholderAtom

import org.apache.poi.util.LittleEndian; //导入方法依赖的package包/类
/**
 * Create a new instance of <code>OEPlaceholderAtom</code>
 */
public OEPlaceholderAtom(){
    _header = new byte[8];
    LittleEndian.putUShort(_header, 0, 0);
    LittleEndian.putUShort(_header, 2, (int)getRecordType());
    LittleEndian.putInt(_header, 4, 8);

    placementId = 0;
    placeholderId = 0;
    placeholderSize = 0;
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:14,代码来源:OEPlaceholderAtom.java

示例15: TextHeaderAtom

import org.apache.poi.util.LittleEndian; //导入方法依赖的package包/类
/**
 * Create a new TextHeader Atom, for an unknown type of text
 */
public TextHeaderAtom() {
	_header = new byte[8];
	LittleEndian.putUShort(_header, 0, 0);
	LittleEndian.putUShort(_header, 2, (int)_type);
	LittleEndian.putInt(_header, 4, 4);

	textType = OTHER_TYPE;
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:12,代码来源:TextHeaderAtom.java


注:本文中的org.apache.poi.util.LittleEndian.putUShort方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。