org.mobicents.protocols.smpp.gsm.ems
Class Picture

java.lang.Object
  extended by org.mobicents.protocols.smpp.gsm.AbstractHeaderElement
      extended by org.mobicents.protocols.smpp.gsm.ems.Picture
All Implemented Interfaces:
HeaderElement
Direct Known Subclasses:
LargePicture, SmallPicture, VariablePicture

public abstract class Picture
extends AbstractHeaderElement

Base class for picture implementations.

Version:
$Id: Picture.java 484 2010-02-08 16:08:50Z orank $

Constructor Summary
Picture(int iei, BufferedImage image)
           
Picture(int iei, BufferedImage image, int position)
           
 
Method Summary
protected abstract  void checkImage(BufferedImage image)
          Check if an image is ok to encode as this Picture type.
protected  boolean doWrite(int segmentNum, ByteBuffer buffer)
           
 byte[] getData()
           
protected  int getExtraHeaderSize()
          Get the number of bytes, beyond the image position, that this picture implementation needs to write to the header.
 int getLength()
          Get the total number of octets this header element encodes as excluding the IEI and the IEI-Data-Length fields.
 int getPosition()
           
 void setPosition(int position)
           
protected  void writeHeader(BufferedImage image, ByteBuffer buffer)
          Write any extra header information this picture implementation needs after the 'position' element.
 
Methods inherited from class org.mobicents.protocols.smpp.gsm.AbstractHeaderElement
equals, isComplete, isRecurring, postProcess, reset, write
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Picture

public Picture(int iei,
               BufferedImage image)

Picture

public Picture(int iei,
               BufferedImage image,
               int position)
Method Detail

getLength

public int getLength()
Description copied from interface: HeaderElement
Get the total number of octets this header element encodes as excluding the IEI and the IEI-Data-Length fields.

Returns:
The number of octets in this header element's IE-Data, which may exceed 140 octets.

getPosition

public int getPosition()

setPosition

public void setPosition(int position)

getData

public byte[] getData()

doWrite

protected boolean doWrite(int segmentNum,
                          ByteBuffer buffer)
Overrides:
doWrite in class AbstractHeaderElement

checkImage

protected abstract void checkImage(BufferedImage image)
Check if an image is ok to encode as this Picture type.

Parameters:
image - The image to check.

getExtraHeaderSize

protected int getExtraHeaderSize()
Get the number of bytes, beyond the image position, that this picture implementation needs to write to the header.

Returns:
This default implementation returns zero.

writeHeader

protected void writeHeader(BufferedImage image,
                           ByteBuffer buffer)
Write any extra header information this picture implementation needs after the 'position' element.

This default method does nothing, leaving the buffer unaffected.

Parameters:
image - The image this picture represents.
buffer - The buffer to write header information to.


Copyright © 2011 Mobicents. All Rights Reserved.